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

Spoiler tags? #923

Open
amytimed opened this issue Apr 30, 2022 · 3 comments
Open

Spoiler tags? #923

amytimed opened this issue Apr 30, 2022 · 3 comments

Comments

@amytimed
Copy link

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?

@bandantonio
Copy link
Collaborator

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

Screen Shot 2022-04-30 at 16 52 36

Related to #761

@amytimed
Copy link
Author

amytimed commented May 2, 2022

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

@bandantonio
Copy link
Collaborator

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

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

No branches or pull requests

2 participants