From 822304b19f81386a36eb7175f7384e2a8c5fd5e1 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Thu, 14 Jul 2016 11:40:55 -0700 Subject: fix Gitlab::Highlight#initializer bugs from rebase --- lib/gitlab/highlight.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb index fbed65a055b..57b7fc139f8 100644 --- a/lib/gitlab/highlight.rb +++ b/lib/gitlab/highlight.rb @@ -13,9 +13,10 @@ module Gitlab highlight(file_name, blob.data, repository: repository).lines.map!(&:html_safe) end - def initialize(blob_name, blob_content) + def initialize(blob_name, blob_content, repository: nil) @formatter = Rouge::Formatters::HTMLGitlab.new @repository = repository + @blob_name = blob_name @lexer = custom_language || begin Rouge::Lexer.guess(filename: blob_name, source: blob_content).new rescue Rouge::Lexer::AmbiguousGuess => e -- cgit v1.2.1