If you parse the following:
(similar variations work also, such as foo | foo, but this is the simplest), then the location option shows one line too high. In addition, all subsequently parsed elements also have their locations off by one, throwing line numbers off for the rest of the document.
Simple test case:
#!/usr/bin/env ruby
require 'kramdown'
puts Kramdown::Document.new('`|`').root.children.first.options[:location]
I believe this is related to a failed attempt to parse this as a table, and then somehow messing up the parser's idea of what the current line number is. It looks like the line number is being incorrectly increased/reset at this point: https://github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/kramdown/table.rb#L69 but I'm still looking to see if I can identify exactly what is happening.
Edit: this is with kramdown 1.3.3
If you parse the following:
(similar variations work also, such as
foo | foo, but this is the simplest), then the location option shows one line too high. In addition, all subsequently parsed elements also have their locations off by one, throwing line numbers off for the rest of the document.Simple test case:
I believe this is related to a failed attempt to parse this as a table, and then somehow messing up the parser's idea of what the current line number is. It looks like the line number is being incorrectly increased/reset at this point: https://github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/kramdown/table.rb#L69 but I'm still looking to see if I can identify exactly what is happening.
Edit: this is with kramdown 1.3.3