Class: Plutonium::UI::Display::Components::Markdown

Inherits:
Phlexi::Display::Components::Base
  • Object
show all
Includes:
Phlexi::Display::Components::Concerns::DisplaysValue, Component::Methods
Defined in:
lib/plutonium/ui/display/components/markdown.rb

Constant Summary collapse

RENDERER =
Redcarpet::Markdown.new(
  Redcarpet::Render::HTML.new(
    safe_links_only: true, with_toc_data: true, hard_wrap: true,
    link_attributes: {rel: :nofollow, target: :_blank}
  ),
  autolink: true, tables: true, no_intra_emphasis: true,
  fenced_code_blocks: true, disable_indented_code_blocks: true,
  strikethrough: true, space_after_headers: true, superscript: true,
  footnotes: true, highlight: true, underline: true
)

Instance Method Summary collapse

Instance Method Details

#render_value(value) ⇒ Object



24
25
26
27
28
# File 'lib/plutonium/ui/display/components/markdown.rb', line 24

def render_value(value)
  article(**attributes) {
    raw(safe(render_markdown(value)))
  }
end