Skip to content

Commit

Permalink
Don't break on channel names with dots in the middle.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Jun 12, 2013
1 parent 3cfb26d commit 48e830e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/irclogger/viewer_helpers.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 48e830e

Please sign in to comment.