Permalink
Browse files

Multiply lines fix

  • Loading branch information...
1 parent 04a7e71 commit 2d56e426d97a36908333178b2fdf472c5f950677 @mensfeld committed Apr 8, 2012
Showing with 8 additions and 3 deletions.
  1. +3 −1 CHANGELOG.rdoc
  2. +5 −2 lib/ruggby/string_encoder.rb
View
@@ -1,2 +1,4 @@
-= Version 0.1.0
+= Version 0.3.0
* Basic functionality: login, change status, send messages, receive messages
+= Version 0.3.1
+* Multiply lines handler fix
@@ -9,7 +9,7 @@ class StringEncoder
INPUT = 'UTF-8'
OUTPUT = 'windows-1250'
- STRIP_REGEXP = /<span.*>(.*)<\/span>/ix
+ STRIP_REGEXP = /<span.*?>(.*)<\/span>/ix
# Convert message into INPUT format
def self.to_input(msg)
@@ -34,9 +34,12 @@ def self.strip(msg)
# Perform both strip and utf8 conversion
def self.complex(msg)
- to_input(strip(msg))
+ add_newlines(to_input(strip(msg)))
end
+ def self.add_newlines(msg)
+ msg.gsub!('<br>', "\r\n")
+ end
end
end

0 comments on commit 2d56e42

Please sign in to comment.