summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 50df3801703..77d99140c43 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -1,6 +1,6 @@
module BlobHelper
def highlight(blob_name, blob_content, nowrap: false, continue: false)
- @formatter ||= Rugments::Formatters::HTML.new(
+ @formatter ||= Rouge::Formatters::HTMLGitlab.new(
nowrap: nowrap,
cssclass: 'code highlight',
lineanchors: true,
@@ -8,11 +8,11 @@ module BlobHelper
)
begin
- @lexer ||= Rugments::Lexer.guess(filename: blob_name, source: blob_content).new
+ @lexer ||= Rouge::Lexer.guess(filename: blob_name, source: blob_content).new
result = @formatter.format(@lexer.lex(blob_content, continue: continue)).html_safe
rescue
- lexer = Rugments::Lexers::PlainText
- result = @formatter.format(lexer.lex(blob_content)).html_safe
+ @lexer = Rouge::Lexers::PlainText
+ result = @formatter.format(@lexer.lex(blob_content)).html_safe
end
result