diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-12-20 14:48:09 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-01-05 15:53:07 +0100 |
commit | 288b276077987bc77f191d2cb93eb2f764c5c1ef (patch) | |
tree | fe41897661fdb8754fe12edffa6ee31e009d0705 /lib/banzai | |
parent | 58a705aaacfb137d654e5f1313c9e5f898422eed (diff) | |
download | gitlab-ce-288b276077987bc77f191d2cb93eb2f764c5c1ef.tar.gz |
Copy Mermaid graphs as GFMdm-copy-mermaid-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 |