Add comments and clean up test for !1274

This commit is contained in:
Stan Hu 2015-09-10 14:21:14 -07:00
parent b2f3d024c3
commit 267687993a
2 changed files with 2 additions and 3 deletions

View file

@ -24,6 +24,8 @@ module Gitlab
begin
highlighted = block_code(code, language)
rescue
# Gracefully handle syntax highlighter bugs/errors to ensure
# users can still access an issue/comment/etc.
highlighted = "<pre>#{code}</pre>"
end

View file

@ -4,9 +4,6 @@ module Gitlab::Markdown
describe SyntaxHighlightFilter do
include FilterSpecHelper
let(:project) { create(:empty_project) }
let(:reference) { snippet.to_reference }
it 'highlights valid code blocks' do
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")