gomarkdown / markdown

markdown parser and HTML renderer for Go
Other
1.36k stars 171 forks source link

No support for separate table headers by a single dash #274

Closed zyxkad closed 1 year ago

zyxkad commented 1 year ago

For, example, if we have the following markdown:

| F1 | F2 | F3 |
| - | - | - |
| 1 | 2 | 3 |

It should be render like https://gist.github.com/zyxkad/dfee41cf4a1cbdd75c04e8df3253c11b

<table>
  <thead>
    <tr>
      <th>F1</th>
      <th>F2</th>
      <th>F3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
    </tr>
  </tbody>
</table>

But it will render it as:

<p>| F1 | F2 | F3 |
| - | - | - |
| 1 | 2 | 3 |</p>

Go playground: https://go.dev/play/p/22vg0xdyjcc

kjk commented 1 year ago

Babelmark: https://babelmark.github.io/?text=%7C+F1+%7C+F2+%7C+F3+%7C%0A%7C+-+%7C+-+%7C+-+%7C%0A%7C+1+%7C+2+%7C+3+%7C

Half do a table, half don't recognize it.

zyxkad commented 1 year ago

So can you add an option to enable or disable the single dash sep?

zyxkad commented 1 year ago
Screen Shot 2023-03-10 at 3 56 09 PM Screen Shot 2023-03-10 at 3 58 22 PM

I think these two is the only things need to change?