soasme / nim-markdown

A Beautiful Markdown Parser in the Nim World.

Home Page:https://www.soasme.com/nim-markdown/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue generating tables in newer versions

jasonrbriggs opened this issue · comments

Hitting a weird issue with nim-markdown, where tables are not generating after I updated to 0.8.0. For example with this input:

| Header 1 | Header 2 | Header 3 | Header 4 |
| -------- | -------- | -------- | -------- |
| Cell 1   | Cell 2   | Cell 3   | Cell 4   |
| Cell 5   | Cell 6   | Cell 7   | Cell 8   |

I get this output with 0.8.0:

xps13:~$ markdown < test.txt
<p>| Header 1 | Header 2 | Header 3 | Header 4 |
| -------- | -------- | -------- | -------- |
| Cell 1   | Cell 2   | Cell 3   | Cell 4   |
| Cell 5   | Cell 6   | Cell 7   | Cell 8   |</p>

If I install 0.4.0 it goes back to working again:

xps13:~$ markdown < test.txt
<table>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
...

The issue is there with #head as well, but if I download head and run tests, it seems to work fine - which is particularly weird. BTW, same issue programmatically as well as via command line.

v0.5.2 looks okay as well.

commented

@jasonrbriggs nim-markdown is now by default a CommonMark implementation, not GitHub Flavor Markdown implementation, therefore Table (A GFM feature) is not enabled automatically.

If you'd like to enable this feature, please initialize Markdown with the GFM config set.

markdown(doc, config=initGfmConfig())