showdown
showdown copied to clipboard
Spoiler tags?
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?
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:
![Screen Shot 2022-04-30 at 16 52 28](https://user-images.githubusercontent.com/16765690/166108307-db198000-61fc-4c33-9167-356bed156aaa.png)
![Screen Shot 2022-04-30 at 16 52 36](https://user-images.githubusercontent.com/16765690/166108311-2433aae4-b1bd-49ce-8458-faace9447094.png)
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 could do it in css only (excluding extension code)