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/dal_syntax.rb | 6 +++--- lib/sisu/v2/epub_tune.rb | 7 ++----- lib/sisu/v2/html_tune.rb | 7 ++----- lib/sisu/v2/odf.rb | 10 +++++----- lib/sisu/v2/shared_xml.rb | 2 ++ lib/sisu/v2/texpdf_format.rb | 2 ++ lib/sisu/v3/dal_syntax.rb | 4 ++-- lib/sisu/v3/epub_tune.rb | 5 +---- lib/sisu/v3/html_tune.rb | 5 +---- lib/sisu/v3/odf.rb | 12 ++++++------ lib/sisu/v3/shared_xml.rb | 2 ++ lib/sisu/v3/texpdf_format.rb | 2 ++ 12 files changed, 30 insertions(+), 34 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index 47c7f8d0..55556371 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.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: @@ -327,7 +327,7 @@ module SiSU_Syntax else dob.obj.gsub!(/^\s*(?:(by\s+)?(?:@creator|@author))\s*$/,'\1') 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!(//,'<:\1>') #escaped special character dob.obj.gsub!(/ /,"#{Mx[:nbsp]}") #escaped special character @@ -398,6 +398,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]}]|$)/, @@ -409,7 +410,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 diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index 10583936..9c9223a0 100644 --- a/lib/sisu/v2/epub_tune.rb +++ b/lib/sisu/v2/epub_tune.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: @@ -349,11 +349,8 @@ module SiSU_EPUB_Tune dob.obj.gsub!(/!new/,%{ new}) dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if dob.obj =~/\b\S+\@\S+?\.\S+/ \ - and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/ - dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'<\1>') - end dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration if dob.obj =~/..\/\S+/ \ and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb index 9d3dce0b..99ce1b0f 100644 --- a/lib/sisu/v2/html_tune.rb +++ b/lib/sisu/v2/html_tune.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: @@ -321,11 +321,8 @@ module SiSU_HTML_Tune dob.obj.gsub!(/!new/,%{ new}) dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if dob.obj =~/\b\S+\@\S+?\.\S+/ \ - and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/ - dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'<\1>') - end dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration if dob.obj =~/..\/\S+/ \ and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb index 2e2a88b4..b6ec4c1b 100644 --- a/lib/sisu/v2/odf.rb +++ b/lib/sisu/v2/odf.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: @@ -291,10 +291,10 @@ module SiSU_ODF def normal(dob) #P1 - P3 dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration - dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj= if dob.is=='para' and dob.indent.to_s =~/[0-9]/ # and t_o.bullet_==true %{#{dob.obj}} else %{#{dob.obj}} @@ -372,10 +372,10 @@ module SiSU_ODF parray=[] dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration - dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each do |parablock| parablock=group_clean(parablock) parablock.gsub!(/<text:a xlink:type="simple" xlink:href="(.+?)">/m,'') diff --git a/lib/sisu/v2/shared_xml.rb b/lib/sisu/v2/shared_xml.rb index 2fcab17e..e82f51bf 100644 --- a/lib/sisu/v2/shared_xml.rb +++ b/lib/sisu/v2/shared_xml.rb @@ -398,6 +398,8 @@ module SiSU_XML_munge if dob.of=='group' dob.obj.gsub!(/#{Mx[:gl_bullet]}/,'● ') end + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}") dob.obj.gsub!(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}") dob.obj.gsub!(/ |#{Mx[:nbsp]}/m,' ') 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}") 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!(//,'<:\1>') #escaped special character dob.obj.gsub!(/ /,"#{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 diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index 746a112e..19453fc8 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/epub_tune.rb @@ -347,11 +347,8 @@ module SiSU_EPUB_Tune dob.obj.gsub!(/!new/,%{ new}) dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if dob.obj =~/\b\S+\@\S+?\.\S+/ \ - and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/ - dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'<\1>') - end dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration if dob.obj =~/..\/\S+/ \ and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb index 18b4576b..5bbcdf6c 100644 --- a/lib/sisu/v3/html_tune.rb +++ b/lib/sisu/v3/html_tune.rb @@ -319,11 +319,8 @@ module SiSU_HTML_Tune dob.obj.gsub!(/!new/,%{ new}) dob.obj.gsub!(/<:h(.{1,7}?)>/,'\1') dob.obj.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if dob.obj =~/\b\S+\@\S+?\.\S+/ \ - and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/ - dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'<\1>') - end dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration if dob.obj =~/#{Xx[:html_relative2]}\/\S+/ \ and dob.obj !~/(\"#{Xx[:html_relative2]}\/\S+?\"|>\s*#{Xx[:html_relative2]}\/\S+<)/ diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index 204f0e50..c14a6c91 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -294,10 +294,10 @@ module SiSU_ODF def normal(dob,p_num='') #P1 - P3 dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration - dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj= if dob.is=='para' and dob.indent.to_s =~/[0-9]/ # and t_o.bullet_==true %{#{dob.obj}#{p_num}} else %{#{dob.obj}#{p_num}} @@ -377,10 +377,10 @@ module SiSU_ODF parray=[] dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration - dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each do |parablock| parablock=group_clean(parablock) parablock.gsub!(/<text:a xlink:type="simple" xlink:href="(.+?)">/m,'') @@ -400,10 +400,10 @@ module SiSU_ODF parray=[] dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '\1') #http ftp matches escaped, no decoration + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) #http ftp matches with decoration - dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each do |parablock| parablock=group_clean(parablock) parablock.gsub!(/<text:a xlink:type="simple" xlink:href="(.+?)">/m,'') diff --git a/lib/sisu/v3/shared_xml.rb b/lib/sisu/v3/shared_xml.rb index 06b89395..daf59a4c 100644 --- a/lib/sisu/v3/shared_xml.rb +++ b/lib/sisu/v3/shared_xml.rb @@ -398,6 +398,8 @@ module SiSU_XML_munge if dob.of=='block' dob.obj.gsub!(/#{Mx[:gl_bullet]}/,'● ') end + dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}) dob.obj.gsub!(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}") dob.obj.gsub!(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}") dob.obj.gsub!(/ |#{Mx[:nbsp]}/m,' ') diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 114c3cb6..a91095e8 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/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