aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/shared_metadata.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/sisu/v2/shared_metadata.rb b/lib/sisu/v2/shared_metadata.rb
index cd46bd1d..69a92070 100644
--- a/lib/sisu/v2/shared_metadata.rb
+++ b/lib/sisu/v2/shared_metadata.rb
@@ -192,7 +192,7 @@ module Metadata
end
if defined? @md.notes.comment \
and @md.notes.comment=~/\S+/
- @tag,@inf,@class=tr.comments,@md.notes.comments,'ext'
+ @tag,@inf,@class=tr.comments,@md.notes.comment,'ext'
meta << self.meta_para
end
if defined? @md.notes.prefix_a \
@@ -474,13 +474,19 @@ WOK
def meta_para
url_brace=SiSU_Viz::Skin.new.url_decoration
if @inf.class==String
- @inf.gsub!(/<br>/,'<br />')
+ @inf.gsub!(/</,'&lt;'); @inf.gsub!(/>/,'&gt;')
+ @inf.gsub!(/&lt;br(?: \/)?&gt;/,'<br />')
@inf.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
@inf.gsub!(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
'\1<text:a xlink:type="simple" xlink:href="\2">\2</text:a>') #special case \{ e.g. \}http://url
- @inf.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
- %{#{url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{url_brace.xml_close}}) #http ftp matches with decoration
+ if @inf =~/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/
+ @inf.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,
+ %{#{url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{url_brace.xml_close}}) #http ftp matches with decoration
+ else
+ @inf.gsub!(/(https?:\/\/\S+)/,
+ %{#{url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{url_brace.xml_close}}) #http ftp matches with decoration
+ end
@inf.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/,
%{#{url_brace.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{url_brace.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol
end
@@ -672,7 +678,7 @@ WOK
end
if defined? @md.notes.comment \
and @md.notes.comment=~/\S+/
- tag,inf=tr.comments,@md.notes.comments
+ tag,inf=tr.comments,@md.notes.comment
meta << meta_para(tag,inf)
end
if defined? @md.notes.prefix_a \