Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-09-06 07:34:25 +0300
committerMark Chao <mchao@gitlab.com>2018-10-30 10:44:55 +0300
commit39ae9a59a59615092fbef189466f37c34f4a7fb1 (patch)
treec8611265f8fb290cbce92f04cadb593b531165ee /app/views/shared/_file_highlight.html.haml
parent32f9cf8ce3dd337bf3b1683c5872171c253f0d27 (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 'app/views/shared/_file_highlight.html.haml')
-rw-r--r--app/views/shared/_file_highlight.html.haml6
1 files changed, 3 insertions, 3 deletions
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