Class: Madness::CustomRenderer
- Inherits:
-
Redcarpet::Render::HTML
- Object
- Redcarpet::Render::HTML
- Madness::CustomRenderer
- Includes:
- Rouge::Plugins::Redcarpet
- Defined in:
- lib/madness/rendering/redcarpet_custom.rb
Overview
Renderer with syntax highlighting support
Instance Method Summary collapse
Instance Method Details
#block_code(code, language) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/madness/rendering/redcarpet_custom.rb', line 11 def block_code(code, language) if language == 'mermaid' # Escape HTML so diagrams using < > characters (class diagrams with # <|-- realization arrows, <<interface>> annotations, etc.) survive # the browser's HTML parser. Mermaid reads .textContent, which gives # back the decoded source. "<div class='mermaid'>#{CGI.escapeHTML(code)}</div>" else super end end |