Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD033: Organizing information with collapsed sections #1191

Open
Obegg opened this issue Apr 28, 2024 · 7 comments
Open

MD033: Organizing information with collapsed sections #1191

Obegg opened this issue Apr 28, 2024 · 7 comments
Labels

Comments

@Obegg
Copy link

Obegg commented Apr 28, 2024

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?

@DavidAnson
Copy link
Owner

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.

@Obegg
Copy link
Author

Obegg commented Apr 29, 2024

let's assume I don't want inline HTML - how do I get the same result (collapsed section)?

@DavidAnson
Copy link
Owner

I don't think the CommonMark specification (or GFM extensions) offers a way to do that.

@Obegg
Copy link
Author

Obegg commented Apr 29, 2024

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>

@DavidAnson
Copy link
Owner

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

@Obegg
Copy link
Author

Obegg commented Apr 29, 2024

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.

@DavidAnson
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants