Method: Kramdown::Parser::Base.parse

Defined in:
lib/kramdown/parser/base.rb

.parse(source, options = {}) ⇒ Object

Parse the source string into an element tree, possibly using the parsing options, and return the root element of the element tree and an array with warning messages.

Initializes a new instance of the calling class and then calls the #parse method that must be implemented by each subclass.



67
68
69
70
71
# File 'lib/kramdown/parser/base.rb', line 67

def self.parse(source, options = {})
  parser = new(source, options)
  parser.parse
  [parser.root, parser.warnings]
end