Permalink
Browse files

Http-ize links starting with www.

  • Loading branch information...
1 parent 6f1c64f commit 89d67d4b13d2aa710d846689e38042e203492877 @whitequark committed Sep 22, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/irclogger/viewer_helpers.rb
@@ -49,7 +49,12 @@ def format_message(text, nicks=nil)
all
else
text = b + c
- %(#{a}<a href="#{text}" class="link" target="_blank">#{text}</a>#{d})
+ if text =~ %r{\Ahttps?://}
+ link = text
+ else
+ link = "http://#{text}"
+ end
+ %(#{a}<a href="#{link}" class="link" target="_blank">#{text}</a>#{d})
end
end.
# *bold*

0 comments on commit 89d67d4

Please sign in to comment.