Browse files

Strip nulls from the file (irssi seems to insert a few)

  • Loading branch information...
1 parent b4ebbaf commit 1564e9a5169dc2a9c1e86093252459bb566765b5 @trejkaz committed Feb 4, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/ircformat/html_convertor.rb
View
3 lib/ircformat/html_convertor.rb
@@ -57,6 +57,9 @@ def irc_to_html(string, options = {})
result += "<div style=\"#{InlineStyler.body_style}\">\n"
end
string.each_line do |line|
+ # For some reason IRC clients can pollute the logs with null characters...
+ line.gsub!(/\000/, '')
+
IrcFormat::Parser.new(@code_parsers).parse_formatted_string(line.chomp).each do |fragment|
text = self.escape_html(fragment[1])
if options[:inline_styles]

0 comments on commit 1564e9a

Please sign in to comment.