Class: Irwi::Formatters::RedCarpet
- Inherits:
-
Object
- Object
- Irwi::Formatters::RedCarpet
- Defined in:
- lib/irwi/formatters/red_carpet.rb
Instance Method Summary collapse
- #format(text) ⇒ Object
-
#initialize ⇒ RedCarpet
constructor
A new instance of RedCarpet.
Constructor Details
#initialize ⇒ RedCarpet
Returns a new instance of RedCarpet.
3 4 5 |
# File 'lib/irwi/formatters/red_carpet.rb', line 3 def initialize require 'redcarpet' end |
Instance Method Details
#format(text) ⇒ Object
7 8 9 10 |
# File 'lib/irwi/formatters/red_carpet.rb', line 7 def format( text ) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true, :tables => true) markdown.render(text) end |