static public Method

RedCloth.new( string, restrictions = [] )

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>"

Source Code

# File redcloth.rb, line 254
def initialize( string, restrictions = [] )
    restrictions.each { |r| method( "#{ r }=" ).call( true ) }
    super( string )
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.