summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-06-15 12:04:25 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-07-14 10:08:15 -0700
commit96274c2765ad4daa23af667b27dc647a3406d7c0 (patch)
tree7bdb23b6d160ea0f274ad40031606b9af91f029a
parent2ae837f9c9c62272efae4f6dbb1d33cbba325389 (diff)
downloadgitlab-ce-96274c2765ad4daa23af667b27dc647a3406d7c0.tar.gz
add the wrapping back in for the banzai filter
-rw-r--r--lib/banzai/filter/syntax_highlight_filter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/banzai/filter/syntax_highlight_filter.rb b/lib/banzai/filter/syntax_highlight_filter.rb
index 536b478979f..c06de2e5b37 100644
--- a/lib/banzai/filter/syntax_highlight_filter.rb
+++ b/lib/banzai/filter/syntax_highlight_filter.rb
@@ -20,7 +20,7 @@ module Banzai
code = node.text
begin
- highlighted = block_code(code, language)
+ highlighted = %<<pre class="#{css_classes}"><code>#{block_code(code, language)}</code></pre>>
rescue
# Gracefully handle syntax highlighter bugs/errors to ensure
# users can still access an issue/comment/etc.
@@ -31,6 +31,10 @@ module Banzai
replace_parent_pre_element(node, highlighted)
end
+ def css_classes
+ "code highlight js-syntax-highlight #{lexer.tag}"
+ end
+
private
def replace_parent_pre_element(node, highlighted)