Skip to content

Commit 76cdcaf

Browse files
committed
Need parent pre for non pygmentized code
1 parent 56876f2 commit 76cdcaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/peek/rblineprof/controller_helpers.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Doesn't have pygments.rb installed
55
end
66

7+
require 'rack/utils'
8+
79
module Peek
810
module Rblineprof
911
module ControllerHelpers
@@ -23,7 +25,7 @@ def pygmentize(file_name, code, lexer = nil)
2325
if pygmentize? && lexer.present?
2426
Pygments.highlight(code, :lexer => lexer_for_filename(file_name))
2527
else
26-
code
28+
"<pre>#{Rack::Utils.escape_html(code)}</pre>"
2729
end
2830
end
2931

0 commit comments

Comments
 (0)