Skip to content

crash in table parser #254

Closed
Closed

Description

@ckruse

I just noticed a problem in the table parser. Given the following document:

----|-------------------------------------|
----|-------------------------------------|
----|-------------------------------------|
----|-------------------------------------|
----|-------------------------------------|

(notice the trailing newline) the kramdown parser breaks as follows:

➜ ckruse@vali ~  % kramdown ./test.md
/Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown/table.rb:94:in `parse_table': undefined method `strip' for nil:NilClass (NoMethodError)
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:140:in `block (2 levels) in parse_blocks'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:138:in `any?'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:138:in `block in parse_blocks'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:136:in `catch'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:136:in `parse_blocks'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/kramdown.rb:89:in `parse'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/parser/base.rb:69:in `parse'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/lib/kramdown/document.rb:107:in `initialize'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/bin/kramdown:59:in `new'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/gems/kramdown-1.7.0/bin/kramdown:59:in `<top (required)>'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/bin/kramdown:23:in `load'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/bin/kramdown:23:in `<main>'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
  from /Users/ckruse/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
➜ ckruse@vali ~  % kramdown -v
1.7.0
➜ ckruse@vali ~  %

This happens as well when I use the kramdown parser in a Ruby block.

Activity

  1. self-assigned this
    on May 19, 2015
  2. gettalong commented on May 19, 2015

    @gettalong
    Owner

    Thanks for the bug report! I will look into it as soon as I have time.

  3. gettalong commented on Jul 1, 2015

    @gettalong
    Owner

    Fixed!

  4. ckruse commented on Jul 1, 2015

    @ckruse
    Author

    Great, thanks!

  5. added a commit that references this issue on Jul 1, 2015
    c37e128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions