Add option to allow or prohibit html attributes
See original GitHub issueI’d like to set the markdownlint.json file so that it allows HTML tags such as <table>
, <tr>
, <td>
… tags, but prohibits any attributes like onclick
or onmouseover
. I’ve found the "MD033": { "allowed_elements": ["table", "tr"]}
entry, but no way of banning or allowing specific attributes within those tags.
I would like to have something like:
"MD033": {
"allowed_elements": ["table", "tr"],
"allowed_attributes": ["class", "style"]
}
Why: I want to avoid the risk of accidentally letting through malicious code inside Pull Requests. I’m also converting docs from XHTML generated by Madcap Flare into markdown. Some of the tables are complex, with tables inside tables, multiple uses of colspan and rowspan. I am setting aside such tables from the conversion process (I’m using pypandoc in python, a thin wrapper for pandoc).
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HTML attribute: disabled - HTML: HyperText Markup Language
This Boolean disabled attribute indicates that the user cannot interact with the control or its descendant controls.
Read more >HTML option disabled Attribute - W3Schools
The disabled attribute is a boolean attribute. When present, it specifies that an option should be disabled. A disabled option is unusable and...
Read more >Add disable attribute on select options using function return html
I am using this function to add option in to select box. Options are added successfully but i don't know to add extra...
Read more >Those HTML Attributes You Never Use - Smashing Magazine
And just to emphasize, this attribute doesn't accept custom values ... been added as well as the value attribute on an individual list...
Read more >Disable HTML elements - Orange digital accessibility guidelines
Disable a link # · remove the href attribute so that it can no longer receive the focus · add a role="link" so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Someone who wants to bypass the rules can disable them with a comment. 😃 The linter is meant to help well-meaning people and is not a security boundary.
Thanks David, I’ll use that argument to justify adapting the .markdownlint file in my repo.