Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in table parser #254

Closed
ckruse opened this issue May 19, 2015 · 3 comments
Closed

crash in table parser #254

ckruse opened this issue May 19, 2015 · 3 comments
Assignees
Labels
bug

Comments

@ckruse
Copy link

@ckruse ckruse commented May 19, 2015

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.

@gettalong gettalong self-assigned this May 19, 2015
@gettalong gettalong added the bug label May 19, 2015
@gettalong
Copy link
Owner

@gettalong gettalong commented May 19, 2015

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

@gettalong
Copy link
Owner

@gettalong gettalong commented Jul 1, 2015

Fixed!

@gettalong gettalong closed this Jul 1, 2015
@ckruse
Copy link
Author

@ckruse ckruse commented Jul 1, 2015

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.