diff options
author | Constance Okoghenun <constanceokoghenun@gmail.com> | 2018-11-05 10:33:05 +0100 |
---|---|---|
committer | Constance Okoghenun <constanceokoghenun@gmail.com> | 2018-11-05 10:33:05 +0100 |
commit | 3bac1a322c82dd9b6e9b23edd66fa45afaa9859f (patch) | |
tree | d3e7d47a3e0c8047cb2972aefbc12fe1e3080ef8 /app/helpers/blob_helper.rb | |
parent | fe7b6f57120946a5d5fe4a4d54a245dc76b06dc8 (diff) | |
parent | 9e2eb85e365e2a33e52e3f1f48cc23ad4201a52b (diff) | |
download | gitlab-ce-issue_51323.tar.gz |
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into issue_51323issue_51323
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index ff7f1e3a9aa..638744a1426 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -1,9 +1,8 @@ # frozen_string_literal: true module BlobHelper - def highlight(blob_name, blob_content, repository: nil, plain: false) - plain ||= blob_content.length > Blob::MAXIMUM_TEXT_HIGHLIGHT_SIZE - highlighted = Gitlab::Highlight.highlight(blob_name, blob_content, plain: plain, repository: repository) + def highlight(file_name, file_content, language: nil, plain: false) + highlighted = Gitlab::Highlight.highlight(file_name, file_content, plain: plain, language: language) raw %(<pre class="code highlight"><code>#{highlighted}</code></pre>) end |