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.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb
index f258f0a9..85368a28 100644
--- a/lib/sisu/v0/shared_html_lite.rb
+++ b/lib/sisu/v0/shared_html_lite.rb
@@ -93,7 +93,7 @@ module SiSU_Format_Shared
else m,u=/\{(.+?)\}((?:https?|file|ftp)\S+|image)/.match(word).captures
d=''
end
- case m
+ word=case m
when /\.png|\.jpg|\.gif|c=|\d+x\d+/
w,h=/(\d+)x(\d+)/.match(m).captures if m =~/\d+x\d+/
w=%{width="#{w}"} if w
@@ -117,20 +117,18 @@ module SiSU_Format_Shared
#ins=%{#{link} <a href="#{u}">[link]</a>#{d}}
word.gsub!(/\{.+?\}(?:https?|file|ftp)\S+/,ins)
end
- word
else word
end
word
end
- @words
+ @words=@words.join(' ')
end
def markup(para)
if para !~/^<:code>/
if para =~/\{.+?\}((?:https?|file|ftp)\S+|image)/
wm=para.scan(/\{.+?\}(?:(?:https?|file|ftp)\S+|image)|\S+/)
- word_mode=urls(wm)
- words=word_mode.join(' ')
- para.gsub!(/.+/,words)
+ words=urls(wm)
+ para.gsub!(/.+/m,words)
end
para.gsub!(/\b[_\\]((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'<a href="\1" target="_top">\1</a>\2') #http ftp matches escaped, no decoration
para.gsub!(/((?:^|\s)[}])((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1<a href="\2" target="_top">\2</a>\3') #special case \{ e.g. \}http://url