class Madness::Rendering::Pandoc
Public Instance Methods
Source
# File lib/madness/rendering/pandoc.rb, line 8 def render(text) text = process_mermaid_blocks text if config.mermaid PandocRuby.new(text, [{ from: :gfm, to: :html }], *options).convert end
Private Instance Methods
Source
# File lib/madness/rendering/pandoc.rb, line 15 def options @options ||= config.highlighter ? [] : :no_highlight end
Source
# File lib/madness/rendering/pandoc.rb, line 19 def process_mermaid_blocks(text) text.gsub(/```mermaid\s+(.+?)\s+```/m) do "<div class='mermaid'>#{$1.strip}</div>" end end