mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #1884] MD060 and empty table cells? #2615
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2615
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Originally created by @beep on GitHub (Dec 5, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1884
Hi! A project I contribute to is blocked in upgrading from markdownlint-cli 0.45 to 0.46, and we think it may be related to MD060. But we’re not sure!
Basically, our project relies heavily on tabular data exported from Google docs into Markdown. Those tables look something like this:
This table type has three columns, and the final cell in each row may be empty. If that final cell has content, all’s well; but every row with an empty final cell now generates an error:
Near as we can tell, we’re adhering to the compact style, but it’s very possible we’ve missed something; is there something we should be doing differently?
(Also, it’s possible I’ve filed this question in the wrong repo; sincere apologies if so. I’d be more than happy to redirect.)
@DavidAnson commented on GitHub (Dec 5, 2025):
As implemented, an empty cell in "compact" table style is expected to have a single space, not two. Making that change to your example satisfies the rule and produces no violations.
The single space requirement for empty cells seems natural to me, but was not an explicit design goal and instead is a natural consequence of the implementation for normal cells.
I can imagine why your export tool produces two spaces, but I think it would be improved by writing just one. Alternatively, since the table is being produced by a rule, I think it would be clearer for readers of the Markdown content to produce a table in "aligned" style rather than "compact". Either of those changes should address the issue for you.
I'm open to discussion, but currently not inclined to change the implementation of this rule because a single space seems consistent with the definition of "compact" just as 0 spaces seems consistent with the definition of "tight".
@beep commented on GitHub (Dec 5, 2025):
Thanks so much for the response, @DavidAnson. I absolutely agree that one space would be clearer, but we’re locked into Google Docs’ output; I’m afraid we can’t customize the markdown further. We’ll probably investigate disabling MD060 for now.
Thanks again for the help! It’s much appreciated.