Permalink
Browse files

Strip formatting codes.

  • Loading branch information...
1 parent 3a61851 commit 2eb838450ca8066022c93456add1e287da35d5d7 @whitequark committed Nov 17, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/irclogger/viewer_helpers.rb
@@ -61,6 +61,8 @@ def format_message(text, nicks=nil)
gsub(/(^|\s)(\*[^\s](?:|.*?[^\s])\*)(\s|$)/, '\1<b>\2</b>\3').
# _underlined_
gsub(/(^|\s)(_[^\s](?:|.*?[^\s])_)(\s|$)/, '\1<u>\2</u>\3').
+ # strip color codes
+ gsub(/[\x02\x09\x13\x0f\x15\x16\x1f]|\x03\d{1,2}(,\d{1,2})?/, '').
gsub(Message::NICK_PATTERN) do
if nicks && nicks.include?($1)
"<span class='chain #{nick_class($1)}'>#$1</span>"

0 comments on commit 2eb8384

Please sign in to comment.