Class: RedCloth::TextileDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/redcloth-formatters-ast/textile_doc.rb

Instance Method Summary collapse

Instance Method Details

#to_ast(*rules) ⇒ Object

Generates an AST from the Textile contents.

RedCloth.new( "!some/image/path.png!" ).to_ast
  #=> { :type => :image, :src => "some/image/path.png" }


10
11
12
13
14
15
16
# File 'lib/redcloth-formatters-ast/textile_doc.rb', line 10

def to_ast(*rules)
  apply_rules(rules)
  
  RedCloth::Formatters::AST.reset!
  to(RedCloth::Formatters::AST)
  RedCloth::Formatters::AST.ast
end