summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/html.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-08-30 17:19:55 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-08-30 17:19:55 +0200
commitd79c6ba2008bff7b65029bc50717ca679c43fb5f (patch)
treea9866f71024a96aaa3266aa85500370a693d50e0 /lib/coderay/encoders/html.rb
parente8c56ab7f2d15e8a4fc68a3f7ec3872965e8b9fe (diff)
downloadcoderay-d79c6ba2008bff7b65029bc50717ca679c43fb5f.tar.gz
enable necessary replacements in HTML encoder
Diffstat (limited to 'lib/coderay/encoders/html.rb')
-rw-r--r--lib/coderay/encoders/html.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 37dfa81..629950c 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -206,11 +206,11 @@ module Encoders
style = @span_for_kinds[@last_opened ? [kind, *@opened] : kind]
text = EscapeUtils.escape_html(text)
- # if text.index(/[\0-\t\xB-\x1F]/)
- # # Escape ASCII control codes except \x9 == \t and \xA == \n.
- # text.tr!("\0-\x8\xB-\x1F", ' ') if text.index(/[\0-\x8\xB-\x1F]/)
- # text.gsub!("\t", @expand_tab) if text.index("\t")
- # end
+ if text.index(/[\0-\t\xB-\x1F]/)
+ # Escape ASCII control codes except \x9 == \t and \xA == \n.
+ text.tr!("\0-\x8\xB-\x1F", ' ') if text.index(/[\0-\x8\xB-\x1F]/)
+ text.gsub!("\t", @expand_tab) if text.index("\t")
+ end
text = break_lines(text, style) if @break_lines && (style || @opened.size > 0) && text.index("\n")