[Pipe Tables Extension] Break tables with block-level structures
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
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).
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue's pipe-table examples from GFM example 202 with the Pipe Tables extension, then compare the rendered output with the stated GFM behavior. The work is done when block-level structures terminate or extend the table predictably and the relevant cases are covered by regression tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, markdown
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100