diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-12-20 16:48:09 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-01-05 17:53:07 +0300 |
commit | 288b276077987bc77f191d2cb93eb2f764c5c1ef (patch) | |
tree | fe41897661fdb8754fe12edffa6ee31e009d0705 /lib/banzai | |
parent | 58a705aaacfb137d654e5f1313c9e5f898422eed (diff) |
Copy Mermaid graphs as GFM
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/mermaid_filter.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/banzai/filter/mermaid_filter.rb b/lib/banzai/filter/mermaid_filter.rb index b545b947a2c..65c131e08d9 100644 --- a/lib/banzai/filter/mermaid_filter.rb +++ b/lib/banzai/filter/mermaid_filter.rb @@ -2,16 +2,7 @@ module Banzai module Filter class MermaidFilter < HTML::Pipeline::Filter def call - doc.css('pre[lang="mermaid"]').add_class('mermaid') - doc.css('pre[lang="mermaid"]').add_class('js-render-mermaid') - - # The `<code></code>` blocks are added in the lib/banzai/filter/syntax_highlight_filter.rb - # We want to keep context and consistency, so we the blocks are added for all filters. - # Details: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15107/diffs?diff_id=7962900#note_45495859 - doc.css('pre[lang="mermaid"]').each do |pre| - document = pre.at('code') - document.replace(document.content) - end + doc.css('pre[lang="mermaid"] > code').add_class('js-render-mermaid') doc end |