Class: Restapi::Markup::Markdown
- Inherits:
-
Object
- Object
- Restapi::Markup::Markdown
- Defined in:
- lib/restapi/markup.rb
Instance Method Summary collapse
-
#initialize ⇒ Markdown
constructor
A new instance of Markdown.
- #to_html(text) ⇒ Object
Constructor Details
#initialize ⇒ Markdown
Returns a new instance of Markdown.
21 22 23 24 |
# File 'lib/restapi/markup.rb', line 21 def initialize require 'redcarpet' @redcarpet ||= ::Redcarpet::Markdown.new(::Redcarpet::Render::HTML.new) end |
Instance Method Details
#to_html(text) ⇒ Object
26 27 28 |
# File 'lib/restapi/markup.rb', line 26 def to_html(text) @redcarpet.render(text) end |