lib/kramdown/document.rb in kramdown-1.9.0 vs lib/kramdown/document.rb in kramdown-1.10.0

- old
+ new

@@ -27,11 +27,11 @@ # # require 'kramdown' # # Kramdown::Document.new(text).to_html # -# For detailed information have a look at the Kramdown::Document class. +# For detailed information have a look at the *\Kramdown::Document* class. # # == License # # MIT - see the COPYING file. @@ -98,16 +98,16 @@ # # The +source+ is immediately parsed by the selected parser so that the root element is # immediately available and the output can be generated. def initialize(source, options = {}) @options = Options.merge(options).freeze - parser = (options[:input] || 'kramdown').to_s + parser = (@options[:input] || 'kramdown').to_s parser = parser[0..0].upcase + parser[1..-1] try_require('parser', parser) if Parser.const_defined?(parser) @root, @warnings = Parser.const_get(parser).parse(source, @options) else - raise Kramdown::Error.new("kramdown has no parser to handle the specified input format: #{options[:input]}") + raise Kramdown::Error.new("kramdown has no parser to handle the specified input format: #{@options[:input]}") end end # Check if a method is invoked that begins with +to_+ and if so, try to instantiate a converter # class (i.e. a class in the Kramdown::Converter module) and use it for converting the document.