diff options
author | Robert Speicher <robert@gitlab.com> | 2015-09-10 22:30:21 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-09-10 22:30:21 +0000 |
commit | a5bb85f8a234b2d8463656877712faf10f5bb842 (patch) | |
tree | 39179a37cea7227232d9b2f9d0062539be1b6232 | |
parent | 7904a751f4a6f51af0a8e9e35a31ff17ea444e3e (diff) | |
parent | 267687993a437e0651eb5064c04479e65a43251f (diff) | |
download | gitlab-ce-a5bb85f8a234b2d8463656877712faf10f5bb842.tar.gz |
Merge branch 'rescue-syntax-highlighting-errors-updated' into 'master'
Add comments and clean up test for !1274
See merge request !1279
-rw-r--r-- | lib/gitlab/markdown/syntax_highlight_filter.rb | 2 | ||||
-rw-r--r-- | 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 = "<pre>#{code}</pre>" 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('<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") |