Commit 26768799 authored by Stan Hu's avatar Stan Hu

Add comments and clean up test for !1274

parent b2f3d024
...@@ -24,6 +24,8 @@ module Gitlab ...@@ -24,6 +24,8 @@ module Gitlab
begin begin
highlighted = block_code(code, language) highlighted = block_code(code, language)
rescue rescue
# Gracefully handle syntax highlighter bugs/errors to ensure
# users can still access an issue/comment/etc.
highlighted = "<pre>#{code}</pre>" highlighted = "<pre>#{code}</pre>"
end end
......
...@@ -4,9 +4,6 @@ module Gitlab::Markdown ...@@ -4,9 +4,6 @@ module Gitlab::Markdown
describe SyntaxHighlightFilter do describe SyntaxHighlightFilter do
include FilterSpecHelper include FilterSpecHelper
let(:project) { create(:empty_project) }
let(:reference) { snippet.to_reference }
it 'highlights valid code blocks' do it 'highlights valid code blocks' do
result = filter('<pre><code>def fun end</code>') result = filter('<pre><code>def fun end</code>')
expect(result.to_html).to eq("<pre class=\"code highlight js-syntax-highlight plaintext\"><code>def fun end</code></pre>\n") expect(result.to_html).to eq("<pre class=\"code highlight js-syntax-highlight plaintext\"><code>def fun end</code></pre>\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment