aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/shared_html_lite.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-09-03 21:47:05 +0100
committerRalph Amissah <ralph@amissah.com>2007-09-03 21:47:05 +0100
commit97d41053a2ef2c2402524e1e73edfa2784efff1f (patch)
tree013697d5746f437df3387ef19d765961d3b30fed /lib/sisu/v0/shared_html_lite.rb
parentUpdated sisu-0.57.0 (diff)
parentsisu-0.58 work towards making it possible to describe sisu and sisu markup wi... (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib/sisu/v0/shared_html_lite.rb')
-rw-r--r--lib/sisu/v0/shared_html_lite.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb
index 1218aa79..1046b6c4 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -125,15 +125,17 @@ module SiSU_Format_Shared
@words
end
def markup(para)
- if para =~/\{.+?\}((?:http|ftp)\S+|image)/
- wm=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/)
- word_mode=urls(wm)
- words=word_mode.join(' ')
- para.gsub!(/.+/,words)
+ unless para =~/^<:code>/
+ if para =~/\{.+?\}((?:http|ftp)\S+|image)/
+ wm=para.scan(/\{.+?\}(?:(?:https?|ftp)\S+|image)|\S+/)
+ word_mode=urls(wm)
+ words=word_mode.join(' ')
+ para.gsub!(/.+/,words)
+ end
+ 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
end
- 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
end
def paragraph