Commit 822304b1 authored by http://jneen.net/'s avatar http://jneen.net/

fix Gitlab::Highlight#initializer bugs from rebase

parent 7ceb9913
...@@ -13,9 +13,10 @@ module Gitlab ...@@ -13,9 +13,10 @@ module Gitlab
highlight(file_name, blob.data, repository: repository).lines.map!(&:html_safe) highlight(file_name, blob.data, repository: repository).lines.map!(&:html_safe)
end end
def initialize(blob_name, blob_content) def initialize(blob_name, blob_content, repository: nil)
@formatter = Rouge::Formatters::HTMLGitlab.new @formatter = Rouge::Formatters::HTMLGitlab.new
@repository = repository @repository = repository
@blob_name = blob_name
@lexer = custom_language || begin @lexer = custom_language || begin
Rouge::Lexer.guess(filename: blob_name, source: blob_content).new Rouge::Lexer.guess(filename: blob_name, source: blob_content).new
rescue Rouge::Lexer::AmbiguousGuess => e rescue Rouge::Lexer::AmbiguousGuess => e
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment