diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-06-15 22:04:25 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-07-14 20:08:15 +0300 |
commit | 96274c2765ad4daa23af667b27dc647a3406d7c0 (patch) | |
tree | 7bdb23b6d160ea0f274ad40031606b9af91f029a /lib/banzai | |
parent | 2ae837f9c9c62272efae4f6dbb1d33cbba325389 (diff) |
add the wrapping back in for the banzai filter
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/syntax_highlight_filter.rb | 6 |
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) |