vendor/bundle/ruby/2.6.0/gems/html-pipeline-2.14.1/lib/html/pipeline/markdown_filter.rb
def call
        extensions = context.fetch(
          :commonmarker_extensions,
          DEFAULT_COMMONMARKER_EXTENSIONS
        )
        html = if (renderer = context[:commonmarker_renderer])
          unless renderer < CommonMarker::HtmlRenderer
            raise ArgumentError, "`commonmark_renderer` must be derived from `CommonMarker::HtmlRenderer`"
          end
          parse_options = :DEFAULT
          parse_options = [:UNSAFE] if context[:unsafe]

          render_options = [:GITHUB_PRE_LANG]
          render_options << :HARDBREAKS if context[:gfm] != false
          render_options << :UNSAFE if context[:unsafe]

          doc = CommonMarker.render_doc(@text, parse_options, extensions)
          renderer.new(options: render_options, extensions: extensions).render(doc)
        else
          options = [:GITHUB_PRE_LANG]
          options << :HARDBREAKS if context[:gfm] != false
          options << :UNSAFE if context[:unsafe]
          CommonMarker.render_html(@text, options, extensions)
        end
        html.rstrip!
        html
      end
# Convert Markdown to HTML using the best available implementation
# and convert into a DocumentFragment.
Convert Markdown to HTML using the best available implementation
and convert into a DocumentFragment.
Convert Markdown to HTML using the best available implementation and convert into a DocumentFragment .
def call
        extensions = context.fetch(
          :commonmarker_extensions,
          DEFAULT_COMMONMARKER_EXTENSIONS
        )
        html = if (renderer = context[:commonmarker_renderer])
          unless renderer < CommonMarker::HtmlRenderer
            raise ArgumentError, "`commonmark_renderer` must be derived from `CommonMarker::HtmlRenderer`"
          end
          parse_options = :DEFAULT
          parse_options = [:UNSAFE] if context[:unsafe]
          render_options = [:GITHUB_PRE_LANG]
          render_options << :HARDBREAKS if context[:gfm] != false
          render_options << :UNSAFE if context[:unsafe]
          doc = CommonMarker.render_doc(@text, parse_options, extensions)
          renderer.new(options: render_options, extensions: extensions).render(doc)
        else
          options = [:GITHUB_PRE_LANG]
          options << :HARDBREAKS if context[:gfm] != false
          options << :UNSAFE if context[:unsafe]
          CommonMarker.render_html(@text, options, extensions)
        end
        html.rstrip!
        html
      end
def call extensions = context . fetch ( :commonmarker_extensions , DEFAULT_COMMONMARKER_EXTENSIONS ) html = if ( renderer = context [ :commonmarker_renderer ] ) unless renderer < CommonMarker :: HtmlRenderer raise ArgumentError , "`commonmark_renderer` must be derived from `CommonMarker::HtmlRenderer`" end parse_options = :DEFAULT parse_options = [ :UNSAFE ] if context [ :unsafe ] render_options = [ :GITHUB_PRE_LANG ] render_options << :HARDBREAKS if context [ :gfm ] != false render_options << :UNSAFE if context [ :unsafe ] doc = CommonMarker . render_doc ( @text , parse_options , extensions ) renderer . new ( options : render_options , extensions : extensions ) . render ( doc ) else options = [ :GITHUB_PRE_LANG ] options << :HARDBREAKS if context [ :gfm ] != false options << :UNSAFE if context [ :unsafe ] CommonMarker . render_html ( @text , options , extensions ) end html . rstrip! html end
Convert Markdown to HTML using the best available implementation
and convert into a DocumentFragment.
Convert Markdown to HTML using the best available implementation and convert into a DocumentFragment .