Method: Kramdown::Parser::Base#initialize

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

#initialize(source, options) ⇒ Base

Initialize the parser object with the source string and the parsing options.

The @root element, the @warnings array and @text_type (specifies the default type for newly created text nodes) are automatically initialized.



52
53
54
55
56
57
58
59
# File 'lib/kramdown/parser/base.rb', line 52

def initialize(source, options)
  @source = source
  @options = Kramdown::Options.merge(options)
  @root = Element.new(:root, nil, nil, encoding: (source.encoding rescue nil), location: 1,
                      options: {}, abbrev_defs: {}, abbrev_attr: {})
  @warnings = []
  @text_type = :text
end