markdownfmt icon indicating copy to clipboard operation
markdownfmt copied to clipboard

Problems with large padded tables

Open jlevy opened this issue 7 years ago • 2 comments

This is another issue that may be more of a topic for discussion than a bug. It involves some unanticipated consequences to how tables are formatted.

When large tables are made, the large padded tables are ungainly for two reasons:

  • A single large cell (for example, a cell with a link or two in it) spreads the table so wide the padding is useless
  • A single-line change can have non-local changes on every other line

The second issue is the worst, since it effectively means two simultaneous changes to any table will always conflict in GitHub (even if it's to different rows).

In general, to avoid merge conflicts, it'd be great if markdownfmt has only "local" changes, i.e. changes to one line don't affect many other lines in the doc.

Suggested fix: No longer pad table cells with whitespace. Alternately never pad tables if the width will be more than a fixed size, like 80 or 120 chars.

jlevy avatar Oct 10 '16 23:10 jlevy

Your observations make sense. There's probably some room for improvement. The current algorithm is very simple and consistent. It'll take some thinking to come up with something better.

dmitshur avatar Oct 12 '16 06:10 dmitshur

If you'd like a living example of this challenge, take a look at https://github.com/open-guides/og-aws

Now #31 is fixed, this is the remaining near-blocking issue to us using this by default.

Many thanks!

jlevy avatar Oct 13 '16 06:10 jlevy