aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/shared_html_lite.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/shared_html_lite.rb')
-rw-r--r--lib/sisu/v0/shared_html_lite.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb
index 76def67d..16491ebf 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -126,14 +126,14 @@ module SiSU_Format_Shared
end
def markup(para)
if para =~/\{.+?\}((?:http|ftp)\S+|image)/
- @word_mode=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/)
- word_mode=urls(para)
+ wm=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/)
+ word_mode=urls(wm)
words=word_mode.join(' ')
para.gsub!(/.+/,words)
end
- para.gsub!(/(^|\s)[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #http ftp matches escaped, no decoration
+ para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'<a href="\1" target="_top">\1</a>\2') #http ftp matches escaped, no decoration
para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #special case \{ e.g. \}http://url
- para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,%{\\1#{@url_brace.xml_open}<a href="\\2" target="_top">\\2</a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration
+ para.gsub!(/\b((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([.,]?(?:\s|$))/,%{#{@url_brace.xml_open}<a href="\\1" target="_top">\\1</a>#{@url_brace.xml_close}\\2}) #http ftp matches with decoration
para
end
def paragraph