diff options
author | Mark Chao <mchao@gitlab.com> | 2018-09-06 07:34:25 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-10-30 10:44:55 +0300 |
commit | 39ae9a59a59615092fbef189466f37c34f4a7fb1 (patch) | |
tree | c8611265f8fb290cbce92f04cadb593b531165ee /lib/gitlab/diff | |
parent | 32f9cf8ce3dd337bf3b1683c5872171c253f0d27 (diff) |
Make Highlight accept language param
This replaces the repository param.
This allows more flexiblity as sometimes we have highlight content
not related to repository. Sometimes we know ahead of time the language
of the content. Lastly language determination seems better fit as a
logic in the Blob class.
`repository` param is only used to determine the language, which seems
to be the responsiblity of Blob.
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/highlight.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb index a605ddb5c33..1d833183ec3 100644 --- a/lib/gitlab/diff/highlight.rb +++ b/lib/gitlab/diff/highlight.rb @@ -79,7 +79,7 @@ module Gitlab return [] unless blob blob.load_all_data! - Gitlab::Highlight.highlight(blob.path, blob.data, repository: repository).lines + blob.present.highlight.lines end end end |