Skip to content

Add Normalization Support for PipeTables (GFM) - #954

Merged
xoofx merged 6 commits into
xoofx:mainfrom
boxofyellow:users/boxofyellow/2026-09/normalize-tables_0
Sep 19, 2026
Merged

xoofx merged 6 commits into
xoofx:mainfrom
boxofyellow:users/boxofyellow/2026-09/normalize-tables_0

Conversation

@boxofyellow

Copy link
Copy Markdown
Contributor

This PR attempts to complete the work started in

Which was part of

This PR adds support for PipeTables. The existing work that was done in #184 was cherry-picked and only updated slightly to catch it up with all of the other changes since it was created.

The original PR was delayed because three of its included tests were failing. This update revalidates the same table-normalization work against the current tree with those same tests, which are now passing without any additional changes. I was able to produce a similar problem that was described in the original PR's comments if I included two of the test cases' tables without a new line between them

| Foo |
| --- |
| Hello World |
| Foo | Bar |
| --- | --- |
| Hello World | *World* |

will yield

| Foo |  |
| --- |
| Hello World |  |
| Foo | Bar |
| --- | --- |
| Hello World | *World* |

But that is expected, that is one table, where the first 2 rows only have one cell's worth of data, while the remaining three rows have two cells.

I did find one problems while experimenting with this, the original implementation would always include an extra new line after the table. I fixed that and added a test to catch it PipeTablesFollowedByText.

Important

The scope of this PR is PipeTables tables, and as implemented it tries format all tables as PipeTables. So it will try to - and normally fail to - render GridTables as PipeTables
So input like this

+---------------+---------------+-------+
| Product       | Category      | Price |
+===============+===============+=======+
| Laptop        | Electronics   | $999  |
| Parts         | Components    |       |
+---------------+---------------+-------+
| Chair with    | Furniture     | $150  |
| Table         |               |       |
+---------------+---------------+-------+

Will yield

| Product | Category | Price |
| --- | --- | --- |
| Laptop
Parts | Electronics
Components | $999 |
| Chair with
Table | Furniture | $150 |

I could exclude rendering tables if the Grid Extension is in use, but since it gets included with UseAdvancedExtensions I think that will result in this getting skipped more often than it needs to be. Additionally without this change it gets rendered as follow which is not any better.

ProductCategoryPriceLaptop
PartsElectronics
Components$999Chair with
TableFurniture$150

@xoofx
xoofx merged commit 6168275 into xoofx:main Sep 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants