mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #455] Pipe Tables: Normalize using header column count #1045
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/xoofx/markdig/pull/455
State: closed
Merged: Yes
This is a potential fix for #454.
In this PR I'm introducing
PipeTableOptions.UseHeaderForColumnCount, an option that allows switching the PipeTables extension's normalization behavior. It's defaulting to the current behavior (find the row with the most columns and make sure all other rows have the same amount of cells). When setting this option totrue, the normalization will follow the example in GitHub's spec and remove/add cells in all rows until they match the number of cells in the header row.I'm adding this as a draft PR for now since I need some guidance around the test suite:
Right now, I've changed the markdown example specs to conform to the new behavior and made the new behavior the default. Ideally, we'd have tests for both, the current and the new behavior - I just don't know how to do this. Does the markdown spec notation allow us to specify certain options to be used for the
MarkdownPipeline?