summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-10 13:43:44 +0000
committerRalph Amissah <ralph@amissah.com>2011-03-10 13:43:57 +0000
commit755acef8c7673081e9fb946d789d394afaee68ee (patch)
tree961e24d40e555b1ab5b0472f8e06029fd3a563eb
parentv2, v3: texpdf, url (regex) pattern match fix (diff)
downloadsisu-755acef8c7673081e9fb946d789d394afaee68ee.zip
sisu-755acef8c7673081e9fb946d789d394afaee68ee.tar.xz
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)
-rw-r--r--data/doc/sisu/CHANGELOG_v24
-rw-r--r--data/doc/sisu/CHANGELOG_v34
-rw-r--r--lib/sisu/v2/dal_syntax.rb6
-rw-r--r--lib/sisu/v2/epub_tune.rb7
-rw-r--r--lib/sisu/v2/html_tune.rb7
-rw-r--r--lib/sisu/v2/odf.rb10
-rw-r--r--lib/sisu/v2/shared_xml.rb2
-rw-r--r--lib/sisu/v2/texpdf_format.rb2
-rw-r--r--lib/sisu/v3/dal_syntax.rb4
-rw-r--r--lib/sisu/v3/epub_tune.rb5
-rw-r--r--lib/sisu/v3/html_tune.rb5
-rw-r--r--lib/sisu/v3/odf.rb12
-rw-r--r--lib/sisu/v3/shared_xml.rb2
-rw-r--r--lib/sisu/v3/texpdf_format.rb2
14 files changed, 38 insertions, 34 deletions
diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2
index cecd65f..23c482e 100644
--- a/data/doc/sisu/CHANGELOG_v2
+++ b/data/doc/sisu/CHANGELOG_v2
@@ -18,6 +18,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_2.8.2.orig.tar.gz
sisu_2.8.2-1.dsc
sisu_2.8.2-1.diff.gz
+ * dal_syntax and affected downstream output modules, revised pattern match
+ for mail, (removes occasional interference with urls having embedded email
+ addresses)
+
* texpdf: url (regex) pattern match fix (/https?/)
%% 2.8.1.orig.tar.gz (2011-03-05:09/6)
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index be20de8..97d15bf 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -19,6 +19,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.3.orig.tar.gz
sisu_3.0.3-1.dsc
sisu_3.0.3-1.debian.tar.gz
+ * dal_syntax and affected downstream output modules, revised pattern match
+ for mail, (removes occasional interference with urls having embedded email
+ addresses)
+
* texpdf: url (regex) pattern match fix (/https?/)
%% 3.0.2.orig.tar.gz (2011-03-05:09/6)
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 47c7f8d..5555637 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!(/<!(\S+)!>/,'<:\1>') #escaped special character
dob.obj.gsub!(/&nbsp;/,"#{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 1058393..9c9223a 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/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- 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._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #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}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@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 9d3dce0..99ce1b0 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/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- 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._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #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}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@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 2e2a88b..b6ec4c1 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]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #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}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
%{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration
- dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
- %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@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
%{<text:p text:style-name="P1#{dob.indent}">#{dob.obj}</text:p>}
else %{<text:p text:style-name="P1">#{dob.obj}</text:p>}
@@ -372,10 +372,10 @@ module SiSU_ODF
parray=[]
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #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}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
%{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration
- dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
- %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@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!(/&lt;text:a xlink:type="simple" xlink:href="(.+?)"&gt;/m,'<text:a xlink:type="simple" xlink:href="\1">')
diff --git a/lib/sisu/v2/shared_xml.rb b/lib/sisu/v2/shared_xml.rb
index 2fcab17..e82f51b 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!(/&nbsp;|#{Mx[:nbsp]}/m,'&#160;')
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 19e53d3..dbf0d09 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</a>#{@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 2de931f..6125356 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
diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb
index 746a112..19453fc 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/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- 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._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #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}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@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 18b4576..5bbcdf6 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/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- 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._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #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}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@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 204f0e5..c14a6c9 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]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #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}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
%{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration
- dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
- %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@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
%{<text:p text:style-name="P1#{dob.indent}">#{dob.obj}#{p_num}</text:p>}
else %{<text:p text:style-name="P1">#{dob.obj}#{p_num}</text:p>}
@@ -377,10 +377,10 @@ module SiSU_ODF
parray=[]
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #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}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
%{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration
- dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
- %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@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!(/&lt;text:a xlink:type="simple" xlink:href="(.+?)"&gt;/m,'<text:a xlink:type="simple" xlink:href="\1">')
@@ -400,10 +400,10 @@ module SiSU_ODF
parray=[]
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #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}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
%{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration
- dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
- %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@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!(/&lt;text:a xlink:type="simple" xlink:href="(.+?)"&gt;/m,'<text:a xlink:type="simple" xlink:href="\1">')
diff --git a/lib/sisu/v3/shared_xml.rb b/lib/sisu/v3/shared_xml.rb
index 06b8939..daf59a4 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!(/&nbsp;|#{Mx[:nbsp]}/m,'&#160;')
diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb
index 114c3cb..a91095e 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</a>#{@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}")