diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-13 19:39:15 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-13 19:39:15 +0300 |
commit | 0f0af19139db71255934e9a7a5b5cd86420b7186 (patch) | |
tree | 61b8a2b9610e6a1d47fbb5dc3a4b97bcbd1d6bc7 /lib/gitlab/diff | |
parent | 48c45ba9a8a9a5536a3d501e40536cc5b73062a1 (diff) |
Little refactor for usage of html_safe. #3945
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/highlight.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb index 0b6a348acbc..f940b57d596 100644 --- a/lib/gitlab/diff/highlight.rb +++ b/lib/gitlab/diff/highlight.rb @@ -22,7 +22,7 @@ module Gitlab content = blob.data lexer = Rouge::Lexer.guess(filename: file_name, source: content).new rescue Rouge::Lexers::PlainText.new - formatter.format(lexer.lex(content)).lines + formatter.format(lexer.lex(content)).lines.map!(&:html_safe) end def self.formatter @@ -73,7 +73,7 @@ module Gitlab # Only update text if line is found. This will prevent # issues with submodules given the line only exists in diff content. - line.text = highlighted_line.gsub!(/\A\s/, line_prefix) if highlighted_line + line.text = highlighted_line.gsub!(/\A\s/, line_prefix).html_safe if highlighted_line end @lines |