Class: RedcarpetCompat

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

Overview

Compatibility class; Creates a instance of Redcarpet with the RedCloth API. This instance has no extensions enabled whatsoever, and no accessors to change this. 100% pure, standard Markdown.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, *_dummy) ⇒ RedcarpetCompat

Returns a new instance of RedcarpetCompat.



64
65
66
67
# File 'lib/redcarpet.rb', line 64

def initialize(text, *_dummy)
  @text = text
  @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_html(*_dummy) ⇒ Object



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

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