markdownlint / markdownlint

Markdown lint tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format tables so the columns are equal widths.

rquadling opened this issue · comments

Describe the Enhancement:

It can be easy to write a markdown table.

| Column 1 | Column 2 |
|:---------|:---------|
| Lot of text that takes up space | Small text |
| Small text | Lot of test that takes up space |

But as you can see above, the columns are not all lined up and so with a mutli-column table, this gets a little harder to read.

Having a way to "fix" the above content so it looks like this:

| Column 1                        | Column 2                        |
|:--------------------------------|:--------------------------------|
| Lot of text that takes up space | Small text                      |
| Small text                      | Lot of test that takes up space |

is a LOT nicer to read!

This is literally my first day looking into markdownlint. I'd like to use it via pre-commit, so committed Markdown files, those generated by/from external sources, as well as manually constructed files, are all formatted nicely for readability without the need for a rendered view.

Impacted Rules:

I think the only rule is MD013 due to long lines being made when a LOT of columns are in play.

Describe the Need:

The point of a Markdown file is to be able to read it AND have it nice formatted when presented via a suitable formatter.

Current Alternative

I am unaware even if this is already a capability. I assume all rules are enabled by default. Using --disable MD013 MD033 shows nothing untowards with the Markdown files I have locally.

Can We Help You Implement This?:

Algorithmically, the work should be achievable. I don't know anything about Ruby, but it's just another language that I'm not needing to learn from scratch if there are people to help.