diff options
author | Mark Chao <mchao@gitlab.com> | 2018-09-06 12:34:25 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-10-30 15:44:55 +0800 |
commit | 39ae9a59a59615092fbef189466f37c34f4a7fb1 (patch) | |
tree | c8611265f8fb290cbce92f04cadb593b531165ee /app/views/sherlock | |
parent | 32f9cf8ce3dd337bf3b1683c5872171c253f0d27 (diff) | |
download | gitlab-ce-39ae9a59a59615092fbef189466f37c34f4a7fb1.tar.gz |
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/sherlock')
-rw-r--r-- | app/views/sherlock/queries/_general.html.haml | 2 | ||||
-rw-r--r-- | app/views/sherlock/transactions/_queries.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/sherlock/queries/_general.html.haml b/app/views/sherlock/queries/_general.html.haml index ddc089b0bd7..52c7bc47ca7 100644 --- a/app/views/sherlock/queries/_general.html.haml +++ b/app/views/sherlock/queries/_general.html.haml @@ -36,7 +36,7 @@ %li .code.js-syntax-highlight.sherlock-code :preserve - #{highlight("#{@query.id}.sql", @query.formatted_query)} + #{highlight("#{@query.id}.sql", @query.formatted_query, language: 'sql')} .card .card-header diff --git a/app/views/sherlock/transactions/_queries.html.haml b/app/views/sherlock/transactions/_queries.html.haml index c1ec4b91bb6..5e224f3aa0e 100644 --- a/app/views/sherlock/transactions/_queries.html.haml +++ b/app/views/sherlock/transactions/_queries.html.haml @@ -17,7 +17,7 @@ = t('sherlock.milliseconds') %td .code.js-syntax-highlight.sherlock-code - = highlight("#{query.id}.sql", query.formatted_query) + = highlight("#{query.id}.sql", query.formatted_query, language: 'sql') %td = link_to(t('sherlock.view'), sherlock_transaction_query_path(@transaction, query), |