Skip to content

[Pipe Tables Extension] Break tables with block-level structures #458

Open
@hamvocke

Description

@hamvocke

One more deviation from the GitHub-flavored markdown specification. Again, I'm happy to put some work into this to make markdig more compliant to the GFM specification but with this one I'm completely lost where to start (and I think the preferred behavior is not obvious either).

See this example:

The table is broken at the first empty line, or beginning of another block-level structure

With a structure like this, markdig's pipe tables behave perfectly according to the specification - rendering a table followed by a blockquote:

| abc | def |
| --- | --- |
| bar | baz |
> bar

However, this example seems to trip up markdig's pipe tables:

| abc | def |
| --- | --- |
| a | b |
c

d

According to GFM, this should result in a table with two rows in the body. The second row consists of a cell with c and another empty cell right after. d would be a new paragraph following after the table.

The pipe tables extension renders the entire table as a paragraph with the text put in verbatim, no table is generated.

I think getting a sane behavior in for this one is not that obvious. Comparing markdown parsers you can see that there's no clear consensus on how to treat this kind of case - and the GFM-specified behavior seems to be quite an outlier.

To me, the behavior shown by markdig at the moment is rather surprising. I'd have expected that at the bare minimum, I'd get a table with one body row consisting of a and b cells.

Any thoughts on how to make markdig's behavior a little more predictable or even compliant with GFM?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions