Sha256: 2524cc4b86d45431b6b4e2e2e3df685b8b08ffc13ec8e92a21cbb39d8b11698f

Contents?: true

Size: 494 Bytes

Versions: 4

Compression:

Stored size: 494 Bytes

Contents

# Documentation for RedCarpet: https://github.com/vmg/redcarpet
class MarkdownWriter

  def self.to_html(markdown)
    renderer = Redcarpet::Render::HTML.new(filter_html: false,
    no_styles: true,
    no_images: false,
    with_toc_data: false,
    link_attributes: {:target => "_blank"}
    )
    converter = Redcarpet::Markdown.new(renderer)
    output = converter.render(markdown)
  end

  def self.update_html(obj)
    obj.content_html = MarkdownWriter.to_html(obj.content_md)
  end

end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
railsbricks-3.7.0 lib/railsbricks/assets/lib/markdown_writer.rb
railsbricks-reloaded-3.2.1 lib/railsbricks/assets/lib/markdown_writer.rb
phoenixbricks-3.2.7 lib/railsbricks/assets/lib/markdown_writer.rb
phoenixbricks-3.2.6 lib/railsbricks/assets/lib/markdown_writer.rb