Class: Banzai::Filter::MermaidFilter

Inherits:
HTML::Pipeline::Filter
  • Object
show all
Defined in:
lib/banzai/filter/mermaid_filter.rb

Constant Summary collapse

CSS =
'pre[lang="mermaid"] > code'
XPATH =
Gitlab::Utils::Nokogiri.css_to_xpath(CSS).freeze

Instance Method Summary collapse

Instance Method Details

#callObject


10
11
12
13
14
# File 'lib/banzai/filter/mermaid_filter.rb', line 10

def call
  doc.xpath(XPATH).add_class('js-render-mermaid')

  doc
end