diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2018-01-05 17:09:16 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2018-01-05 17:09:16 +0000 |
commit | 3d162d192ba2a57776de62b553a2a0a9a9245f8a (patch) | |
tree | e1dea8a8d38a1d7b10283038f52bdd00e01d270e /lib | |
parent | b2b780178d8b17bb02a54ae2cbc10f349d9a2d42 (diff) | |
parent | 288b276077987bc77f191d2cb93eb2f764c5c1ef (diff) | |
download | gitlab-ce-3d162d192ba2a57776de62b553a2a0a9a9245f8a.tar.gz |
Merge branch 'dm-copy-mermaid-as-gfm' into 'master'
Copy Mermaid graphs as GFM
Closes #41211
See merge request gitlab-org/gitlab-ce!16046
Diffstat (limited to 'lib')
-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 |