I've found an idea that is really easy to implement to make this work:
Add <details>
, <summary>
and the open
attribute to the HTML whitelist.
The <details>
tag is, by default, a collapsible section with a customizable title. Take a look at some HTML and its output.
<head>
<title>How the <Details> tag Works</title>
</head>
<body>
<details>
<summary>Click to open!</summary>
I'm normally closed!
</details>
<hr>
<details open>
<summary>Click to close!</summary>
I'm normally open!
</details>
</body>
Output:
The <summary>
tag goes inside the <details>
tag. It contains the text that should go on the header of the collapsible section.
The open
attribute is a boolean, in layman's terms, it's either present or absent. If present, it causes the section to be open by default instead of closed.
This should be so easy to implement! No CSS changing, Markdown changes or additions to custom HTML! It's simple, just add <details>
, <summary>
, and the open
attribute to the HTML whitelist.
If When that happens because it will happen, I will enclose the "Original Post" below in a <details>
tag so that it is collapsed. For now, head into the revision history if you want to read it...