module CommonMarker class HtmlRenderer < Renderer def render(node) super(node) end def header(node) block do out('', :children, '') end end def paragraph(node) if @in_tight && node.parent.type != :blockquote out(:children) else block do container('

', '

') do out(:children) end end end end def list(node) old_in_tight = @in_tight @in_tight = node.list_tight block do if node.list_type == :bullet_list container("') do out(:children) end else start = if node.list_start == 1 "
    \n" else "
      \n" end container(start, '
    ') do out(:children) end end end @in_tight = old_in_tight end def list_item(_) block do container('
  1. ', '
  2. ') do out(:children) end end end def blockquote(_) block do container("
    \n", '
    ') do out(:children) end end end def hrule(_) block do out('
    ') end end def code_block(node) block do out('
    ')
            else
              out('>')
            end
            out(escape_html(node.string_content))
            out('
    ') end end def html(node) block do out(node.string_content) end end def inline_html(node) out(node.string_content) end def emph(_) out('', :children, '') end def strong(_) out('', :children, '') end def link(node) out('', :children, '') end def image(node) out('', :children, '') end def text(node) out(escape_html(node.string_content)) end def code(node) out('') out(escape_html(node.string_content)) out('') end def linebreak(node) out('
    ') softbreak(node) end def softbreak(_) out("\n") end end end