markdown-it / markdown-it-container

Fenced container plugin for markdown-it markdown parser
MIT License
496 stars 74 forks source link

How to do proper spoiler tags? #30

Closed dessalines closed 5 years ago

dessalines commented 5 years ago

I see the standard for spoiler tags is:

>!multi   
line  
spoiler  
line !<

or >! spoiler !<

According to both reddit and https://meta.stackexchange.com/questions/1191/add-markdown-support-for-hidden-until-you-click-text-aka-spoilers . Has anyone used this container to make this yet?

puzrin commented 5 years ago

This plugin uses fenced marking. Markup from link uses side marking. Those are different.

dessalines commented 5 years ago

So markdown-it currently has no support for any of the most popular implementations of spoiler tags?

puzrin commented 5 years ago

Default package supports only things described in commonmark spec + some github extensions. Everything else should be done via plugins. You may try to search one in npm or do your own, based on blockquote.

KyleMit commented 4 years ago

You can do it with the markdown-it-spoiler plugin, which has a slightly unconventional syntax compared to other implementations, but works just fine.

Here's how you'd use it:

!!Spoiler!!

It probably diverges from other implementations because it's easier to borrow from other markdown it plugins that use pairs of special chars like ++inserted++ or ==marked==