Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown/syntax_highlight_filter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/markdown/syntax_highlight_filter.rb b/lib/gitlab/markdown/syntax_highlight_filter.rb
index 86f4385753a..f9527c7286e 100644
--- a/lib/gitlab/markdown/syntax_highlight_filter.rb
+++ b/lib/gitlab/markdown/syntax_highlight_filter.rb
@@ -21,7 +21,11 @@ module Gitlab
language = node.attr('class')
code = node.text
- highlighted = block_code(code, language)
+ begin
+ highlighted = block_code(code, language)
+ rescue
+ highlighted = "<pre>#{code}</pre>"
+ end
# Replace the parent `pre` element with the entire highlighted block
node.parent.replace(highlighted)