From fda25aa07788a45272285b9832e94629174fd345 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 22 Oct 2010 18:30:22 -0400 Subject: dal, internal link: exclude parentheses and square brackets from matching (requested fix, Ben Armstrong) --- CHANGELOG_v2 | 12 +++++++----- data/doc/sisu/v2/CHANGELOG | 12 +++++++----- lib/sisu/v2/dal_syntax.rb | 6 +++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG_v2 b/CHANGELOG_v2 index 23da40e1..efec522b 100644 --- a/CHANGELOG_v2 +++ b/CHANGELOG_v2 @@ -12,7 +12,7 @@ Reverse Chronological: %% Development branch UNSTABLE -%% 2.7.8.orig.tar.gz (2010-10-21:42/4) +%% 2.7.8.orig.tar.gz (2010-10-22:42/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.8.orig.tar.gz sisu_2.7.8.orig.tar.gz sisu_2.7.8-1.dsc @@ -20,10 +20,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.8.orig.tar.gz [debian freeze, fix] - * html, internal link: remove space between link & following punctuation - (requested fix, Ben Armstrong) - - * epub, internal link: remove space between link & following punctuation + * internal links + * dal, exclude parentheses and square brackets from matching + (requested fix, Ben Armstrong) + * html, remove space between link & following punctuation + (requested fix, Ben Armstrong) + * epub, remove space between link & following punctuation %% 2.7.7.orig.tar.gz (2010-10-17:41/7) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.7.orig.tar.gz diff --git a/data/doc/sisu/v2/CHANGELOG b/data/doc/sisu/v2/CHANGELOG index d69d2289..5af46b2a 100644 --- a/data/doc/sisu/v2/CHANGELOG +++ b/data/doc/sisu/v2/CHANGELOG @@ -12,7 +12,7 @@ Reverse Chronological: %% Development branch UNSTABLE -%% 2.7.8.orig.tar.gz (2010-10-21:42/4) +%% 2.7.8.orig.tar.gz (2010-10-22:42/5) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.8.orig.tar.gz sisu_2.7.8.orig.tar.gz sisu_2.7.8-1.dsc @@ -20,10 +20,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.8.orig.tar.gz [debian freeze, fix] - * html, internal link: remove space between link & following punctuation - (requested fix, Ben Armstrong) - - * epub, internal link: remove space between link & following punctuation + * internal links + * dal, exclude parentheses and square brackets from matching + (requested fix, Ben Armstrong) + * html, remove space between link & following punctuation + (requested fix, Ben Armstrong) + * epub, remove space between link & following punctuation %% 2.7.7.orig.tar.gz (2010-10-17:41/7) http://www.jus.uio.no/sisu/pkg/src/sisu_2.7.7.orig.tar.gz diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index fbc62158..c4059fa8 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -384,11 +384,11 @@ module SiSU_Syntax "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3}) - dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) end if dob.obj=~/_(?:https?|ftp):\S+/m # _http://url #CHECK -- cgit v1.2.3