question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to allow or prohibit html attributes

See original GitHub issue

I’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:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Dec 10, 2021

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.

0reactions
FrancisVilacommented, Dec 10, 2021

Thanks David, I’ll use that argument to justify adapting the .markdownlint file in my repo.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found