From 39ae9a59a59615092fbef189466f37c34f4a7fb1 Mon Sep 17 00:00:00 2001 From: Mark Chao Date: Thu, 6 Sep 2018 12:34:25 +0800 Subject: 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. --- app/views/shared/_file_highlight.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views/shared/_file_highlight.html.haml') diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index 8d64cb5d698..5073e6ad48f 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -1,5 +1,3 @@ -- repository = nil unless local_assigns.key?(:repository) - .file-content.code.js-syntax-highlight .line-numbers - if blob.data.present? @@ -13,4 +11,6 @@ = link_icon = i .blob-content{ data: { blob_id: blob.id } } - = highlight(blob.path, blob.data, repository: repository, plain: blob.no_highlighting?) + %pre.code.highlight + %code + = blob.present.highlight -- cgit v1.2.1