require 'escape_utils'
module CommonMarker
class HtmlRenderer < Renderer
def render(node)
result = super(node)
end
def header(node)
block do
out('
', '
') 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("\n", '') do out(:children) end end end def hrule(node) block do out('
0
out(' class="language-', node.fence_info.split(/\s+/)[0], '">')
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(node)
out('', :children, '')
end
def strong(node)
out('', :children, '')
end
def link(node)
out(' 0
out(' title="', escape_html(node.title), '"')
end
out('>', :children, '')
end
def image(node)
out(' 0
out(' title="', escape_html(node.title), '"')
end
out(' />')
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('