Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

[Bug] GFM Table auto-layout fails and causes disproportionate column compression with long text

Open jara505 opened this issue 2 months ago • 6 comments

Markpad version

2.8.1

How did you install it?

Linux — AppImage

OS and version

CaachyOS- BSPWM

What happens, and what you expected instead

what happens:

When rendering GFM (GitHub Flavored Markdown) tables in Markpad, the table layout engine fails to dynamically distribute column widths properly. If a single cell contains a continuous or extensive block of text, that column expands excessively, forcing adjacent columns (even those with short text) to compress severely—sometimes causing words to stack vertically letter by letter—instead of wrapping naturally or maintaining a balanced layout.

Expected behavior

Tables should handle column width distribution more gracefully, applying a proper auto-layout or word-wrapping mechanism so that short columns do not collapse when another column contains longer text.

Steps to reproduce

  1. Create a markdown table with two or more columns.

  2. Insert a long, continuous sentence or text block into a cell in one column, while keeping the other column short.

  3. Switch to preview mode (or use single-view mode via Ctrl + E).

  4. Observe how the column with short text is disproportionately crushed while the longer column takes up almost all the space.

The Markdown that triggers it

Scenario 1: Long text causing column crushing (Primary case)

| Short Column | Long Column |
| :--- | :--- |
| Item A | This is an extremely long and continuous block of text inside a single cell designed to force the rendering engine into miscalculating width percentages and breaking the layout. |
| Item B | Short |


Scenario 2: Long inline code blocks or links

| Feature | Reference / Command |
| :--- | :--- |
| Database Setup | `CREATE DATABASE EnterpriseDB WITH (EDITION = 'GeneralPurpose', SERVICE_OBJECTIVE = 'GP_S_Gen5_2');` |
| Documentation | [https://github.com/markdown-it/markdown-it/blob/master/support/rule-name-convention.md](https://github.com/markdown-it/markdown-it/blob/master/support/rule-name-convention.md) |

Screenshots, and anything else

Image

jara505 avatar Sep 29 '26 23:09 jara505

Fixed in #929: a cell no longer breaks inside a word, so a short column can't be squeezed narrower than its longest word, and a table that still doesn't fit scrolls sideways. A short column can still wrap between words ("Short / Column") when a long neighbour takes the space. That is how browser table layout divides width, and it now matches how GitHub renders the same table.

PathGao avatar Sep 30 '26 10:09 PathGao

@PathGao

Thanks for merging the fix for this! However, I tested it again using the latest AppImage release on Arch Linux, and the column compression behavior with long text or code blocks still occurs. Not sure if it could be something on my end or if it's still persisting, but just wanted to let you know.


Image

jara505 avatar Oct 06 '26 22:10 jara505

The screenshot shows the table rendering as intended in 2.8.3: no column is squeezed and no word breaks. A table wider than the text column extends into the margins on purpose (#811). Could you confirm the version shown on the Home page or in Settings, and paste the Markdown that still compresses a column? The table in this screenshot doesn't show that.

PathGao avatar Oct 07 '26 04:10 PathGao

@PathGao

Thanks for looking into this! To clarify, the main issue isn't that the table extends into the margins (which makes sense), but rather how the column widths are distributed.

When a cell contains a long paragraph or code block, the adjacent column with short text gets crushed disproportionately (often forcing words to stack vertically letter-by-letter), instead of sharing a balanced auto-layout like other markdown editors handle it.

This is how it should look correctly:

Image

However, Markpad currently shows it like this, which is incorrect:

Image

Here is the exact Markdown snippet that triggers this behavior on v2.8.3:

| Short Column | Long Column |
| :--- | :--- |
| Item A | This is an extremely long and continuous block of text inside a single cell designed to force the rendering engine into miscalculating width percentages. |
| Item B | Short |

Could we look into improving how column widths are calculated so short columns do not collapse?

jara505 avatar Oct 07 '26 05:10 jara505

2.8.4 is out (https://github.com/sftwrdotdev/Markpad/releases/tag/v2.8.4) with two settings in Settings → Preview. By default a wide table now stays within Max width and scrolls sideways with words kept whole, like GitHub. Turn off Scroll Wide Tables if you'd rather squeeze the whole table to fit, words breaking where needed.

PathGao avatar Oct 07 '26 07:10 PathGao

2.9.0 (https://github.com/sftwrdotdev/Markpad/releases/tag/v2.9.0) lets you drag a column border in the preview to widen a squeezed column, and double-click the border to reset it. Automatic layout is the same as 2.8.4, so this is a manual fix, not a change to how widths are divided.

PathGao avatar Oct 29 '26 03:10 PathGao