Skip to content
Browse files

Don't break on channel names with dots in the middle.

  • Loading branch information...
1 parent 3cfb26d commit 48e830e2a4a601e399f70e9122e3a957b42c45a1 @whitequark committed Jun 12, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/irclogger/viewer_helpers.rb
View
4 lib/irclogger/viewer_helpers.rb
@@ -5,11 +5,11 @@ module ViewerHelpers
include Rack::Utils
def channel_escape(channel)
- channel[1..-1].gsub('#', '.')
+ channel[1..-1].gsub(/^#+/) { |m| '.' * m.length }
end
def channel_unescape(channel)
- "##{channel.gsub('.', '#')}"
+ "##{channel.gsub(/^\.+/) { |m| '#' * m.length }}"
end
def channel_url(channel, postfix=nil)

0 comments on commit 48e830e

Please sign in to comment.
Something went wrong with that request. Please try again.