[Pipe Tables Extension] Normalization is inserting extra columns
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 11d 3h
- Merged PRs (30d)
- 6
Description
I'm working with markdig's Pipe Tables Extension and found a case where the specified behavior around normalization is different from what GitHub-flavored Markdown is specifying.
GFM says:
The remainder of the table’s rows may vary in the number of cells. If there are a number of cells fewer than the number of cells in the header row, empty cells are inserted. If there are greater, the excess is ignored
markdig's pipe tables spec says:
The tables are normalized to the maximum number of columns found in a table
This means, a table like this:
| abc | def |
| --- | --- |
| bar |
| bar | baz | boo |
is supposed to result in an HTML table that's got 2 columns according to GFM. The first body row gets an extra, empty <td> while the second body row doesn't include the boo cell.
Running this example through markdig with pipe tables enabled, however, generates a table that's got 3 columns, with the header and the first body row both gaining empty table cells.
I'm wondering if this deviation from GFM is intentional. Is there a reason why the two specifications treat normalization differently? And would it be desirable to make the normalization behavior configurable, e.g. by passing an option to the pipe tables plugin?
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 with src/Markdig.Tests/Specs/PipeTableSpecs.md and the linked GFM example, then reproduce the three-row table case. Compare Markdig’s current three-column output with GFM’s expected two-column result; completion requires an agreed decision on retaining the documented behavior or adopting/configuring GFM normalization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, markdown
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100