Merge pull request #5136 from Meet-Democracy/Legislation-draft-render-markdown-tables

Render markdown tables in legislation draft
This commit is contained in:
Javi Martín
2023-06-30 00:09:33 +02:00
committed by GitHub
9 changed files with 240 additions and 27 deletions

View File

@@ -22,15 +22,11 @@ class Legislation::DraftVersion < ApplicationRecord
scope :published, -> { where(status: "published").order("id DESC") }
def body_html
renderer = Redcarpet::Render::HTML.new(with_toc_data: true)
Redcarpet::Markdown.new(renderer).render(body)
MarkdownConverter.new(body, with_toc_data: true).render
end
def toc_html
renderer = Redcarpet::Render::HTML_TOC.new(with_toc_data: true)
Redcarpet::Markdown.new(renderer).render(body)
MarkdownConverter.new(body).render_toc
end
def display_title