diff options
author | Ralph Amissah <ralph@amissah.com> | 2007-09-03 21:46:47 +0100 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2007-09-03 21:46:47 +0100 |
commit | 2cd558f67f44cca787013c02b665533b97c90f0e (patch) | |
tree | b3b596e2d094014b897dabd1c93e91623b1663d0 /lib/sisu/v0/shared_html_lite.rb | |
parent | sisu-0.57.0 md5s (diff) |
sisu-0.58 work towards making it possible to describe sisu and sisu markup within sisu
Diffstat (limited to 'lib/sisu/v0/shared_html_lite.rb')
-rw-r--r-- | lib/sisu/v0/shared_html_lite.rb | 18 |
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 |