From 78170753d8682c8ea9ae5f75232951d5b8043803 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 10 Mar 2011 08:26:36 -0500 Subject: v2, v3: texpdf, url (regex) pattern match fix --- lib/sisu/v2/texpdf_format.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v2/texpdf_format.rb') diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index 732a903e..19e53d3b 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -970,7 +970,7 @@ WOK para_array=[] str=if word word.each do |w| # _ - / # | : ! ^ ~ - if w !~/http:/ \ + if w !~/https?:/ \ and w=~/\/\S+?\// \ and w.length > 6 w.gsub!(/([_.\/])/,'\1\-') -- cgit v1.2.3 From 755acef8c7673081e9fb946d789d394afaee68ee Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 10 Mar 2011 08:43:44 -0500 Subject: 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) --- lib/sisu/v2/texpdf_format.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sisu/v2/texpdf_format.rb') diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index 19e53d3b..dbf0d095 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -65,6 +65,8 @@ module SiSU_TeX_Pdf @brace_url=SiSU_Viz::Skin.new.url_decoration end def bare_urls + @dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + "#{@brace_url.tex_open}\\1#{@brace_url.tex_close}") @dob.tmp.gsub!(/(^|[^\\])_/m,'\1\_') #watch may not work @dob.tmp.gsub!(/(^|[^#{Mx[:lnk_c]}])#{Mx[:url_o]}_?(?:\\?_)?(\S+?)#{Mx[:url_c]}/m, "\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}") -- cgit v1.2.3