Open amytimed opened 2 years ago
Spoiler tags (details
and summary
) are out of the scope of the common Markdown syntax (and I believe it should stay like that). But you can easily extend your project to support them via the lang
extension:
{
type: 'lang',
regex: /\|\|([\S\s]*?)\|\|/g,
replace: '<details><summary>Click for more details</summary>$1</details>'
}
Markdown:
||Some details that you want to be available when expanding the spoiler||
Resulting HTML:
Related to #761
Yeah, but I was referring to spoiler text in black that you click and which doesn't open or close.
Maybe extreme CSS could Solve My Issue
Ah, ok, I see.
Well, you can still use an extension here to assign a specific class to the tags of your choice (||
or >!
) and then toggle black overlay over the text using a bit of javascript and css
I think spoiler tags would be a great addition to this project!
The syntax could be
||text||
or>!text!<
, maybe even both!This would require some use of CSS and Extra JavaScript, but I think that'd be worth it.
What do you think?