rsc / markdown

Basic Markdown parser and HTML generator
BSD 3-Clause "New" or "Revised" License
81 stars 4 forks source link

Empty column heading not recognized in table #7

Closed matloob closed 8 months ago

matloob commented 8 months ago

Here's a program that compares markdown and goldmark on the following input https://go.dev/play/p/kEslff4EyTa

|          | Foo      | Bar      |
| -------- | -------- | -------- |
| a        | value1   | value2   |
| b        | value3   | value4   |
Rendered in github as Foo Bar
a value1 value2
b value3 value4

The output is

markdown:
<table>
<thead>
<tr>
<th></th>
<th>Foo</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>value1</td>
</tr>
<tr>
<td>b</td>
<td>value3</td>
</tr>
</tbody>
</table>

goldmark:
<table>
<thead>
<tr>
<th></th>
<th>Foo</th>
<th>Bar</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>value1</td>
<td>value2</td>
</tr>
<tr>
<td>b</td>
<td>value3</td>
<td>value4</td>
</tr>
</tbody>
</table>