Module: GovukMarkdown

Defined in:
lib/govuk_markdown.rb,
lib/govuk_markdown/version.rb,
lib/govuk_markdown/renderer.rb,
lib/govuk_markdown/preprocessor.rb

Defined Under Namespace

Classes: Preprocessor, Renderer

Constant Summary collapse

VERSION =
"2.0.2".freeze

Class Method Summary collapse

Class Method Details

.render(markdown, govuk_options = {}) ⇒ Object



9
10
11
12
# File 'lib/govuk_markdown.rb', line 9

def self.render(markdown, govuk_options = {})
  renderer = GovukMarkdown::Renderer.new(govuk_options, { with_toc_data: true, link_attributes: { class: "govuk-link" } })
  Redcarpet::Markdown.new(renderer, tables: true, no_intra_emphasis: true).render(markdown).strip
end