Module: Trenni::Formatters::Markdown
- Defined in:
- lib/trenni/formatters/markdown.rb
Instance Method Summary collapse
Instance Method Details
#markdown(text) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/trenni/formatters/markdown.rb', line 29 def markdown(text) config = Sanitize::Config::BASIC.dup config[:elements] += ['h1', 'h2', 'h3'] html = Sanitize.clean(Kramdown::Document.new(text).to_html, config) return MarkupString.raw(html) end |