summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-07-14 22:43:49 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-07-14 22:43:49 -0700
commitc4ea394736f98aebd6b370d75a5b3556206ce09d (patch)
tree7783d555c727600372094537a7d650fc28a1d46e
parentc763c7e402599a2789e260ecf61c11c68381aaa5 (diff)
downloadgitlab-ce-c4ea394736f98aebd6b370d75a5b3556206ce09d.tar.gz
use %(...) and %[...] in favor of %<...>feature.rouge-20
-rw-r--r--app/helpers/blob_helper.rb2
-rw-r--r--lib/banzai/filter/syntax_highlight_filter.rb4
-rw-r--r--lib/rouge/formatters/html_gitlab.rb4
-rw-r--r--spec/helpers/blob_helper_spec.rb2
4 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 39f9f935d31..abe115d8c68 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -1,7 +1,7 @@
module BlobHelper
def highlight(blob_name, blob_content, repository: nil, plain: false)
highlighted = Gitlab::Highlight.highlight(blob_name, blob_content, plain: plain, repository: repository)
- raw %<<pre class="code highlight"><code>#{highlighted}</code></pre>>
+ raw %(<pre class="code highlight"><code>#{highlighted}</code></pre>)
end
def no_highlight_files
diff --git a/lib/banzai/filter/syntax_highlight_filter.rb b/lib/banzai/filter/syntax_highlight_filter.rb
index 17f9164bcb7..028edef704b 100644
--- a/lib/banzai/filter/syntax_highlight_filter.rb
+++ b/lib/banzai/filter/syntax_highlight_filter.rb
@@ -25,9 +25,9 @@ module Banzai
begin
highlighted = ''
- highlighted << %<<pre class="#{css_classes}"><code>>
+ highlighted << %(<pre class="#{css_classes}"><code>)
highlighted << formatter.format(lexer.lex(code))
- highlighted << %<</code></pre>>
+ highlighted << %(</code></pre>)
rescue
# Gracefully handle syntax highlighter bugs/errors to ensure
# users can still access an issue/comment/etc.
diff --git a/lib/rouge/formatters/html_gitlab.rb b/lib/rouge/formatters/html_gitlab.rb
index b76cf14a536..f818dc78d34 100644
--- a/lib/rouge/formatters/html_gitlab.rb
+++ b/lib/rouge/formatters/html_gitlab.rb
@@ -17,9 +17,9 @@ module Rouge
yield "\n" unless is_first
is_first = false
- yield %<<span id="LC#{@line_number}" class="line">>
+ yield %(<span id="LC#{@line_number}" class="line">)
line.each { |token, value| yield span(token, value) }
- yield %<</span>>
+ yield %(</span>)
@line_number += 1
end
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index e5dfa61fa6a..bd0108f9938 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -17,7 +17,7 @@ describe BlobHelper do
describe '#highlight' do
it 'should return plaintext for unknown lexer context' do
result = helper.highlight(blob_name, no_context_content)
- expect(result).to eq(%<<pre class="code highlight"><code><span id="LC1" class="line">:type "assem"))</span></code></pre>>)
+ expect(result).to eq(%[<pre class="code highlight"><code><span id="LC1" class="line">:type "assem"))</span></code></pre>])
end
it 'should highlight single block' do