Class: RedcarpetCompat

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

Overview

Compatibility class; Creates an instance of Redcarpet with the RedCloth API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, *exts) ⇒ RedcarpetCompat

Returns a new instance of RedcarpetCompat.



61
62
63
64
65
66
# File 'lib/redcarpet.rb', line 61

def initialize(text, *exts)
  exts_hash, render_hash = *parse_extensions_and_renderer_options(exts)
  @text = text
  renderer = Redcarpet::Render::HTML.new(render_hash)
  @markdown = Redcarpet::Markdown.new(renderer, exts_hash)
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



59
60
61
# File 'lib/redcarpet.rb', line 59

def text
  @text
end

Instance Method Details

#to_html(*_dummy) ⇒ Object



68
69
70
# File 'lib/redcarpet.rb', line 68

def to_html(*_dummy)
  @markdown.render(@text)
end