Class: Restapi::Markup::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/restapi/markup.rb

Instance Method Summary collapse

Constructor Details

#initializeMarkdown

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