Class: Jekyll::Converters::Markdown::CommonMarkGhPages

Inherits:
CommonMark
  • Object
show all
Defined in:
lib/jekyll-commonmark-ghpages.rb

Overview

A Markdown renderer which uses JekyllCommonMarkCustomRenderer to output the final document.

Instance Method Summary collapse

Instance Method Details

#convert(content) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/jekyll-commonmark-ghpages.rb', line 52

def convert(content)
  parse_options = (Set.new(@options) & CommonMarker::Config::Parse.keys).to_a
  render_options = (Set.new(@options) & CommonMarker::Config::Render.keys).to_a
  parse_options = :DEFAULT if parse_options.empty?
  render_options = :DEFAULT if render_options.empty?
  doc = CommonMarker.render_doc(content, parse_options, @extensions)
  JekyllCommonMarkCustomRenderer.new(
    :options => render_options,
    :extensions => @extensions
  ).render(doc)
end