summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-07-14 11:40:55 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-07-14 11:40:55 -0700
commit822304b19f81386a36eb7175f7384e2a8c5fd5e1 (patch)
treef61588909770b62113be7d3908665021dfd46e49
parent7ceb9913aa87f1691411d725417e1fd1aadacb9b (diff)
downloadgitlab-ce-822304b19f81386a36eb7175f7384e2a8c5fd5e1.tar.gz
fix Gitlab::Highlight#initializer bugs from rebase
-rw-r--r--lib/gitlab/highlight.rb3
1 files changed, 2 insertions, 1 deletions
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