Replace \n to <br>

This commit is contained in:
Kamil Trzcinski
2016-05-23 21:59:07 -05:00
parent 46de0366b1
commit cdec9e472d
3 changed files with 16 additions and 3 deletions
+3 -1
View File
@@ -90,7 +90,7 @@ module Ci
def convert(raw, new_state)
reset_state
restore_state(raw, new_state) if new_state
restore_state(raw, new_state) if new_state.present?
start = @offset
ansi = raw[@offset..-1]
@@ -105,6 +105,8 @@ module Ci
break
elsif s.scan(/</)
@out << '&lt;'
elsif s.scan(/\n/)
@out << '<br>'
else
@out << s.scan(/./m)
end