diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb index 654c8b6..3c06919 100644 --- a/app/helpers/markdown_helper.rb +++ b/app/helpers/markdown_helper.rb @@ -29,7 +29,7 @@ def codespan(quote) end def block_code(code, _language) - %(#{escape_html(code)}) + %(#{escape_html(code)}) end def header(title, level) @@ -47,6 +47,23 @@ def list_item(content, _list_type) %(
  • #{content}
  • ) end + def table(header, body) + content = <<-HTML + + #{header} + + + #{body} + + HTML + + %(#{content}
    ) + end + + def table_row(content) + %(#{content}) + end + def list(content, list_type) case list_type when :ordered @@ -62,7 +79,7 @@ def render_markdown(text) renderer = CustomRender.new(escape_html: true) # renderer = Redcarpet::Render::HTML.new(hard_wrap: true) - markdown = Redcarpet::Markdown.new(renderer, {}) + markdown = Redcarpet::Markdown.new(renderer, fenced_code_blocks: true, tables: true) markdown.render(text).html_safe end end