class Rote::Filters::BlueCloth
Page
filter that converts markdown formatting to HTML using BlueCloth
.
Public Class Methods
new(*restrictions, &blk)
click to toggle source
Create a new filter instance. The supplied restrictions (if any) are passed directly to BlueCloth
. See BlueCloth
docs for details of supported restrictions.
If a block is supplied, it will be passed the BlueCloth
string at render time, along with the page being rendered. It is expected to return the rendered content. If no block is supplied, to_html is called implicitly.
Calls superclass method
Rote::Filters::TextFilter::new
# File lib/rote/filters/bluecloth.rb 27 def initialize(*restrictions, &blk) 28 super() 29 @restrictions = restrictions 30 @blk = blk || lambda { |bc, page| bc.to_html } 31 end
Public Instance Methods
handler(text,page)
click to toggle source
# File lib/rote/filters/bluecloth.rb 33 def handler(text,page) 34 bc = ::BlueCloth.new(text) 35 @blk.call(bc, page) 36 end