md4c icon indicating copy to clipboard operation
md4c copied to clipboard

Table support differences vs. `cmark-gfm`

Open step- opened this issue 1 year ago • 0 comments

I noticed two differences between cmark-gfm and md2html table rendering. I extracted all examples from test/spec-tables.txt and ran them through cmark-gfm 0.29.0.gfm.13 and md2html 0.5.2. looking for differences. The following two examples showed differences.

In this example cmark-gfm renders an HTML table while md2html does not (consistently with its spec).

  1. The table cannot interrupt a paragraph.
Lorem ipsum dolor sit amet.
| Column 1 | Column 2
| ---------|---------
| foo      | bar
| baz      | qux
| quux     | quuz

In this example cmark-gfm renders

<td>`foo</td>
<td>bar`</td>

while md2html renders (consistently with its spec)

<td><code>foo     | bar</code></td>
<td></td>
  1. However pipes which are inside a code span are not recognized as cell boundaries.
Column 1 | Column 2
---------|---------
`foo     | bar`
baz      | qux
quux     | quuz

Since md2html is behaving per its specification I don't think the differences can be considered defects, though, in practical terms, mark-gfm is doing a better job with those two tables. Your thoughts?

step- avatar Aug 14 '24 10:08 step-