From 267687993a437e0651eb5064c04479e65a43251f Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 10 Sep 2015 14:21:14 -0700 Subject: [PATCH] Add comments and clean up test for !1274 --- lib/gitlab/markdown/syntax_highlight_filter.rb | 2 ++ spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/markdown/syntax_highlight_filter.rb b/lib/gitlab/markdown/syntax_highlight_filter.rb index f9527c7286e..8597e02f0de 100644 --- a/lib/gitlab/markdown/syntax_highlight_filter.rb +++ b/lib/gitlab/markdown/syntax_highlight_filter.rb @@ -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 = "
#{code}
" end diff --git a/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb b/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb index ecef31853f4..6a490673728 100644 --- a/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb +++ b/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb @@ -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('
def fun end')
       expect(result.to_html).to eq("
def fun end
\n")