JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
706 stars 78 forks source link

GFM Tables are not parsed correctly when fewer than three hyphens exist in the delimeter row. #48

Open ajalt opened 4 years ago

ajalt commented 4 years ago

The GFM Spec allows a table's delimeter row to have a single hyphen per column.

The following code:

|a|
|-|
|b|

is valid table:

a
b

But the GFMFlavourDescriptor just parses it as text:

Markdown:PARAGRAPH
  Markdown:TEXT '|a|'
  Markdown:EOL
  Markdown:TEXT '|-|'
  Markdown:EOL
  Markdown:TEXT '|b|'

which is rendered as:

<body><p>|a|
|-|
|b|</p></body>