module GovukMarkdown class Renderer < ::Redcarpet::Render::HTML def table(header, body) <<~HTML #{header} #{body}
HTML end def table_row(content) <<~HTML #{content} HTML end def table_cell(content, _alignment) <<~HTML #{content} HTML end def header(text, header_level) heading_size = case header_level when 1 then "xl" when 2 then "l" when 3 then "m" else "s" end id_attribute = @options[:with_toc_data] ? " id=\"#{text.parameterize}\"" : "" <<~HTML #{text} HTML end def paragraph(text) <<~HTML

#{text}

HTML end def list(contents, list_type) if list_type == :unordered <<~HTML HTML elsif list_type == :ordered <<~HTML
    #{contents}
HTML else raise "Unexpected type #{list_type.inspect}" end end def hrule <<~HTML
HTML end end end