markdownlint
markdownlint copied to clipboard
MD033: Organizing information with collapsed sections
According to github docs: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections
I use:
<details><summary>
Example (Click to expand):
</summary>
But I get error:
MD033/no-inline-html: Inline HTML [Element: details]
What should I do?
If you want to include inline HTML in your Markdown, you should disable the no-inline-html rule. The README shows multiple ways to do so.
let's assume I don't want inline HTML - how do I get the same result (collapsed section)?
I don't think the CommonMark specification (or GFM extensions) offers a way to do that.
So if I understand correctly - this error can't be fixed since there's no way to create collapsed sections without using inline HTML,.
If so - then I guess this extension need to add an exception whenever it detects inline HTML for collapsed sections such as <details> and <summery>
There are many things that can be done in HTML that cannot be done in Markdown. If you want to do many of them, you can disable this rule. If you want to do some of them, you can customize the rule to allow the relevant elements: https://github.com/DavidAnson/markdownlint/blob/main/doc/md033.md
But it should not be custom specifically for me, it should be added globally, I'm not the only one who uses this extension and has collapsed sections.
The rule exists to block HTML and keep Markdown content pure - for people who want that. The specific scenario raised above does not seem to be more special than any other. In fact, this issue may be the first time it has come up.