mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #419] MD033: Feature request: Allow all descendant elements of configured allowed_elements #2195
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#2195
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/419
For any element named in the MD033
allowed_elementsarray, allow any child elements of the named elements.Use case: To cause all HTML tables to be allowed, I have the following configured:
However, the actual tables in my documents also contain descendant
<code>…</code>, and<p>…</p>, etc., markup.I want markdownlint to report those
<code>…</code>, and<p>…</p>, etc., elements when they occur anywhere else in a document — but I just don’t want markdownlint to report them when they are descendants of an HTMLtableelement.So if this feature were implemented, everything would work if I just did the following:
That is, the above would allow any HTML
tableand all its descendant elements.So as an alternative to this request, I raised #420 with a request for a specific option that causes HTML tables to be allowed (including all their descendant elements).
@groenroos commented on GitHub (Feb 19, 2022):
+1 for this; for my usecase, I use Markdown for blog posts, where sometimes embedded HTML content must be added, for example;
I would've wanted to use the
allowed_elementsoption ofMD033to allow everything nested inside the<figure>, as it cannot be replicated in Markdown.However, I would still want this rule to catch the inline HTML
<a>in the paragraph, as that could easily be a[link]().My use case would be totally solved if there was some sort of "all descendants" option for
MD033that excused any children of allowed tags.