Class: Markerb::Markdown
- Inherits:
-
Object
- Object
- Markerb::Markdown
- Defined in:
- lib/markerb/markdown.rb
Class Method Summary collapse
Class Method Details
.to_html(compiled_source) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/markerb/markdown.rb', line 6 def self.to_html(compiled_source) if defined?(Redcarpet) Markerb.renderer ||= Redcarpet::Render::HTML Redcarpet::Markdown.new(Markerb.renderer, Markerb.).render(compiled_source) elsif defined?(Kramdown) Kramdown::Document.new(compiled_source, Markerb.).to_html else raise StandardError, "Markdown processor unavailable, please add either Redcarpet or Kramdown to your project" end end |