summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-01-12 12:53:54 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-01-12 12:53:54 -0500
commitf1f9b5f7d388c6d7a0938229c9211beddb2fd6a2 (patch)
tree9c9097e51a5d0b30fbfeebfc472ff3cd816b7517 /app/helpers/blob_helper.rb
parentc476395b4d8b78cfc7431153a144ffccbd414c61 (diff)
downloadgitlab-ce-f1f9b5f7d388c6d7a0938229c9211beddb2fd6a2.tar.gz
Small fixes from code review. #3945
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 1230002e69c..a80162a3e33 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -11,14 +11,14 @@ module BlobHelper
end
def highlight(blob_name, blob_content, nowrap: false, continue: false)
- @formatter ||= rouge_formatter(nowrap: nowrap)
+ formatter = rouge_formatter(nowrap: nowrap)
begin
@lexer ||= Rouge::Lexer.guess(filename: blob_name, source: blob_content).new
- result = @formatter.format(@lexer.lex(blob_content, continue: continue)).html_safe
+ result = formatter.format(@lexer.lex(blob_content, continue: continue)).html_safe
rescue
@lexer = Rouge::Lexers::PlainText
- result = @formatter.format(@lexer.lex(blob_content)).html_safe
+ result = formatter.format(@lexer.lex(blob_content)).html_safe
end
result