Class: Banzai::Filter::MarkdownEngines::CommonMark

Inherits:
Base
  • Object
show all
Defined in:
lib/banzai/filter/markdown_engines/common_mark.rb

Constant Summary collapse

EXTENSIONS =
[
  :autolink,      # provides support for automatically converting URLs to anchor tags.
  :strikethrough, # provides support for strikethroughs.
  :table          # provides support for tables.
].freeze
PARSE_OPTIONS =
[
  :FOOTNOTES,                  # parse footnotes.
  :STRIKETHROUGH_DOUBLE_TILDE, # parse strikethroughs by double tildes (as redcarpet does).
  :VALIDATE_UTF8               # replace illegal sequences with the replacement character U+FFFD.
].freeze
RENDER_OPTIONS =
[
  :GITHUB_PRE_LANG,  # use GitHub-style <pre lang> for fenced code blocks.
  :FOOTNOTES,        # render footnotes.
  :FULL_INFO_STRING, # include full info strings of code blocks in separate attribute.
  :UNSAFE            # allow raw/custom HTML and unsafe links.
].freeze
RENDER_OPTIONS_SOURCEPOS =
RENDER_OPTIONS + [:SOURCEPOS].freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Banzai::Filter::MarkdownEngines::Base

Instance Method Details

#render(text) ⇒ Object



34
35
36
# File 'lib/banzai/filter/markdown_engines/common_mark.rb', line 34

def render(text)
  CommonMarker.render_html(text, render_options, EXTENSIONS)
end