mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #420] MD033: Feature request: Add option for allowing HTML tables (and all descendant elements) #2197
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#2197
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 @sideshowbarker on GitHub (Aug 15, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/420
This is a request to add a boolean option to allow HTML tables, and all descendant elements. Maybe as an alternative to #419.
Use case: Some tables are too complex to try to represent in Markdown — or too unwieldy in practice for authors to try to edit in Markdown. So it’s not uncommon for large sets of Markdown documents to have some documents with HTML tables.
For example, for the https://github.com/mdn/content/ project, we’ve been converting all our existing HTML sources to Markdown. Currently, the following MDN subtrees have been converted to Markdown:
A significant subset of those documents contain HTML tables that our conversion process did not convert to Markdown.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table is one such example among many that we have in the MDN docs. (And that’s not even one of the most complex tables we have, and not even one of the ones that’d be the most impractical and unwieldy for authors to try to edit in Markdown. We have dozens of others.)
So when using markdownlint, the problem we’ve run into in practice is that markdownlint reports errors for all those tables.
And so the solution we’ve tried is to configure the MD033 value like this:
However, the actual tables in our documents also contain descendant
<code>…</code>, and<p>…</p>, etc., markup. So markdownlint still reports errors for all those other elements. Which is what led me to raise #419.But as an alternative to #419, what would actually be preferable is to have a single option to allow HTML tables — including all their descendant elements.
I can imagine a naive way to implement it would be, when seeing an HTML
<table>start tag, turn off all error reporting until an HTML</table>end tag is seen.I know that would at least solve the problem for the MDN use case.