diff options
author | Mark Chao <mchao@gitlab.com> | 2018-09-11 12:37:44 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-10-30 15:44:55 +0800 |
commit | bc14e4ed1024efa1e0a411bd59e1339fb1af20c0 (patch) | |
tree | 249ac6ce57b9758d3472dd4b1319527636b72f44 /app/helpers/blob_helper.rb | |
parent | 39ae9a59a59615092fbef189466f37c34f4a7fb1 (diff) | |
download | gitlab-ce-bc14e4ed1024efa1e0a411bd59e1339fb1af20c0.tar.gz |
Move :plain option to Highlight class
This is to DRY the repeated file size check.
Move spec and constants to Highlight
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 52cf9d12287..638744a1426 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -2,7 +2,6 @@ module BlobHelper def highlight(file_name, file_content, language: nil, plain: false) - plain ||= file_content.length > Blob::MAXIMUM_TEXT_HIGHLIGHT_SIZE highlighted = Gitlab::Highlight.highlight(file_name, file_content, plain: plain, language: language) raw %(<pre class="code highlight"><code>#{highlighted}</code></pre>) |