aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/dal_syntax.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-10 08:43:44 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-10 08:43:57 -0500
commit755acef8c7673081e9fb946d789d394afaee68ee (patch)
tree961e24d40e555b1ab5b0472f8e06029fd3a563eb /lib/sisu/v3/dal_syntax.rb
parentv2, v3: texpdf, url (regex) pattern match fix (diff)
v2, v3: dal_syntax + downstream output, email regex revised
* revised pattern match for email address, (removes occasional interference with urls having embedded email addresses) (dal_syntax and affected downstream output modules)
Diffstat (limited to 'lib/sisu/v3/dal_syntax.rb')
-rw-r--r--lib/sisu/v3/dal_syntax.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb
index 2de931f6..61253561 100644
--- a/lib/sisu/v3/dal_syntax.rb
+++ b/lib/sisu/v3/dal_syntax.rb
@@ -333,7 +333,7 @@ module SiSU_Syntax
end
end
end
- dob.obj.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup
+ dob.obj.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup
dob.obj.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }http://www.jus.uio.no/sisu') #adjustment 2005w30
dob.obj.gsub!(/<!(\S+)!>/,'<:\1>') #escaped special character
dob.obj.gsub!(/&nbsp;/,"#{Mx[:nbsp]}") #escaped special character
@@ -404,6 +404,7 @@ module SiSU_Syntax
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3") #any remaining linked text or image
dob.obj.gsub!(/\{\s*(.+?)\s*\}(#{Mx[:url_o]}\S+?#{Mx[:url_c]})/,
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #any remaining linked text or image
+ dob.obj.gsub!(/(^|\s)([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,"\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}")
dob.obj.gsub!(/(^|[ ])\{\s*(.+?)\s*\}(\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
"\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4") #any remaining linked text or image
dob.obj.gsub!(/\{\s*(.+?)\s*\}#(\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
@@ -415,7 +416,6 @@ module SiSU_Syntax
elsif dob.is=='table'
dob=fontface(dob)
elsif dob.is =='code'
-#p dob.obj
dob.obj.gsub!(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: ')
dob.obj.gsub!(/([<>])/,'_\1')
dob.obj.gsub!(/_<:(\S+?)_>/,'<:\1>') #convert <:\S+> back, clumsy