Class: Rote::Filters::RedCloth

Inherits:
TextFilter show all
Defined in:
lib/rote/filters/redcloth.rb

Overview

Page filter that converts Textile formatting to HTML using RedCloth.

Note that, although RedCloth provides partial Markdown support, it is highly recommended that the BlueCloth filter be applied to markdown pages instead of this one.

Direct Known Subclasses

RedCloth_WithToc

Instance Attribute Summary

Attributes inherited from TextFilter

#handler_blk, #macros

Instance Method Summary collapse

Methods inherited from TextFilter

#filter

Constructor Details

#initialize(*redcloth_opts) ⇒ RedCloth

Create a new filter instance. The supplied options are passed directly to RedCloth. See RedCloth docs for a full list.

If no options are supplied, full textile support is provided.



28
29
30
31
# File 'lib/rote/filters/redcloth.rb', line 28

def initialize(*redcloth_opts)
  super()  
  @redcloth_opts = redcloth_opts
end

Instance Method Details

#handler(text, page) ⇒ Object



33
34
35
36
# File 'lib/rote/filters/redcloth.rb', line 33

def handler(text,page)
  rc = ::RedCloth.new(text, @redcloth_opts)
  rc.to_html 
end