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

Kramdown 1.15.0 crashes on escaped pipe in Markdown table #477

Closed
fdallaireCoveo opened this issue Nov 28, 2017 · 4 comments
Closed

Kramdown 1.15.0 crashes on escaped pipe in Markdown table #477

fdallaireCoveo opened this issue Nov 28, 2017 · 4 comments
Assignees
Labels

Comments

@fdallaireCoveo
Copy link

fdallaireCoveo commented Nov 28, 2017

The presence of an escaped pipe without spaces around separating ticked values in a Markdown table as in the following table example causes Kramdown 1.15.0 to crash with the message similar to:

Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_ccv2-dev/Security_Identity_Models.md': no implicit conversion of nil into String

| Key              | Value type                                                |
|------------------|-----------------------------------------------------------|
| `Name`           | String                                                    |
| `Type`           | `"GROUP"` \| `"UNKNOWN" \|`"USER"`\|`"VIRTUAL_GROUP"`     |
| `AdditionalInfo` | Object                                                    |
@gettalong gettalong self-assigned this Nov 28, 2017
@gettalong
Copy link
Owner

Hmm... with the latest kramdown version I get the following output and no error:

<table>
  <thead>
    <tr>
      <th>Key</th>
      <th>Value type</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>Name</code></td>
      <td>String</td>
    </tr>
    <tr>
      <td><code>Type</code></td>
      <td><code>"GROUP"</code> | <code>"UNKNOWN" \|</code>“USER”<code>\|</code>“VIRTUAL_GROUP”`</td>
    </tr>
    <tr>
      <td><code>AdditionalInfo</code></td>
      <td>Object</td>
    </tr>
  </tbody>
</table>

Can you try the sample on the command line via the kramdown binary? And update to the latest version?

And it seems your example doesn't use the code backticks correctly...

@fdallaireCoveo
Copy link
Author

Thomas, thanks for the quick answer!
Sorry, I screwed up with my sample.
Here is one for which I get the error with the kramdown command line for both version 1.15.0 and 1.16.1 :

| Key              | Value type                                                |
|------------------|-----------------------------------------------------------|
| `Name`           | String                                                    |
| `Type`           | `"GROUP"`\|`"UNKNOWN"`\|`"USER"`\|`"VIRTUAL_GROUP"`       |
| `AdditionalInfo` | Object                                                    |
/Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:83:in `block (2 levels) in parse_table': no implicit conversion of nil into String (TypeError)
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:76:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:76:in `block in parse_table'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:68:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:68:in `each_with_index'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown/table.rb:68:in `parse_table'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:148:in `block (2 levels) in parse_blocks'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:146:in `any?'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:146:in `block in parse_blocks'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:144:in `catch'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:144:in `parse_blocks'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/kramdown.rb:89:in `parse'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/parser/base.rb:69:in `parse'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/lib/kramdown/document.rb:104:in `initialize'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/bin/kramdown:82:in `new'
	from /Library/Ruby/Gems/2.3.0/gems/kramdown-1.16.1/bin/kramdown:82:in `<top (required)>'
	from /usr/local/bin/kramdown:22:in `load'
	from /usr/local/bin/kramdown:22:in `<main>'

@gettalong
Copy link
Owner

@fdallaireCoveo Fixed and bug fix release 1.16.2 is now available.

@gettalong gettalong added the bug label Nov 29, 2017
@fdallaireCoveo
Copy link
Author

Wow! That was fast. Thank you very much!

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

No branches or pull requests

2 participants