amauryt / cr-cmark-gfm

Crystal C bindings for cmark-gfm to work with Commonmark and Github Flavored Markdown
BSD 2-Clause "Simplified" License
20 stars 4 forks source link

fix render table with a header only #5

Closed mamantoha closed 3 years ago

mamantoha commented 3 years ago

Render next markdown

| Foo | Bar |
| :---: | :---: |

returns

<table> <thead> <tr> <th align="center">Foo</th> <th align="center">Bar</th> </tr> </thead>

after this fix will return proper HTML:

<table> <thead> <tr> <th align="center">Foo</th> <th align="center">Bar</th> </tr> </thead> </table>

Also tested on tables with many rows.

See for reference: https://github.com/github/cmark-gfm/blob/master/extensions/table.c#L664-L672

amauryt commented 3 years ago

Thanks @mamantoha!