Method: RedCloth#initialize

Defined in:
lib/redcloth.rb

#initialize(string, restrictions = []) ⇒ RedCloth

Returns a new RedCloth object, based on string and enforcing all the included restrictions.

r = RedCloth.new( "h1. A <b>bold</b> man", [:filter_html] )
r.to_html
  #=>"<h1>A &lt;b&gt;bold&lt;/b&gt; man</h1>"


256
257
258
259
# File 'lib/redcloth.rb', line 256

def initialize( string, restrictions = [] )
    restrictions.each { |r| method( "#{ r }=" ).call( true ) }
    super( string )
end