What could a "spoiler tag" extension look like?

Just a thought: could spoilers be treated as a special kind of deleted content <del>?

~foo~
~~bar~~
~~~~baz~~~~
~~~~~~~~quuz~~~~~~~~
.
<sub>foo</sub>
<s>bar</s>
<del>baz</del>
<del class="spoiler">quuz</del>
> If this is a blockquote

>! and this is a block spoiler
[> then this could be an inline quote using `<q>`]

[>! and this could be an inline spoiler.]
2 Likes

Looks good @aoudad. I like the simplicity. Plus it degrades… sort of ok

render: commonmark.js demo


For the slightly weird edge case of wanting to hide or shrink the pgp keyblock so it doesn’t take up visual space… Its ok

>! -----BEGIN PGP PUBLIC KEY BLOCK-----
>! Version: 2.6.i
>!
>! mQCNAi+UeBsAAAEEAMP0kXU75GQdzwwlMiwZBUKFUDRgR4wH9y5NP9JaZfVX8shT
>! ESbCTbGSEExB2ktEPh5//dkfftsKNlzlAugKFKTgBv20tQ9lDKfdbPVR0HmTLz0e
>! wVIeqEue4+Mt/Kq7kMcQy+5sX2RBAiZTYl0n/JdY/WxflU0taq1kH/UUPkklAAUR
>! tB5NYXJ0eSBNY0ZseSA8bWFydHlAZnV0dXJlLmNvbT6JAJUCBRAvlHhGrWQf9RQ+
>! SSUBAQX+BACnhx7OTb1SfAcJVF/1kuRPUWuGcl57eZgv4syc1O9T3YNr0terWQBT
>! K0vFR00FdaBv9X9XwlxaBJHGeiBcmhaiOTwB912ysoteUzZHne3sHPw3MkYboAFx
>! xHg43Cnj60OeZG2PKp/kU91ipOJP1cs8/xYOGkeoAMqDfwPeFlkBiA==
>! =ddBN
>! -----END PGP PUBLIC KEY BLOCK-----

Discord have now added support for spoilers, but they are using the ||spoiler|| syntax instead.

I think this really needs standardising.

@aoudad I like the block spoiler there, but the inline one looks weird.

3 Likes

Heads up that reddit is now using this format as a sitewide standard for spoilertext Formatting Guide – Reddit Help

>!spoilers!<

Key thing is they have !< to close off a spoiler. This will be curious to figure out how to work out between inline and block spoilers.

But anyway this is an additional point for >! inclusion in the next standard update.

1 Like

To summit it up we have 3 live versions where two of them is very similar

This make me wonder will it make sense to change the blockqoute standard a little and add a required space after > In that way we could use >! for block spoilers and make it act in the same way as a blockqoute. then we could use >!spoilers!< for inline.

This >!spoilers!< is inline
>! This is a block spoilers 
and it works the same way as blockqoute it can contain other tags inside it.

>! It can also continue just like a normal blockqoute

I personally find it a good solution as the pros and cons are good.

Pros:

  • Big platforms like Reddit and Stack can keep their current solutions.
  • It is a syntax that people are familiar with.
  • It feels like markdown and easy to use as it reminds people of blockqoutes.
  • The syntax of inline and block is familiar.

Corns:

  • We would have to change the blockqoute standard by adding a required space. However the impact of this is very little as it is already good practice and used in most editions.
  • Discord would have to change their syntax, but as most user on the platform doesn’t use markdown when chatting it should not be a bigger problem.
1 Like

If you’re trying to continue the same spoiler block, I think you’d need additional markup in the empty line:

>! This is a block spoilers 
and it works the same way as blockqoute it can contain other tags inside it.
>!
>! It can also continue just like a normal blockqoute

Not trying to be nitpicky, just pointing out the standard. If you have an empty line, in CM, it will be a break between two quotes, like this:

Stuff 1

Stuff 2

> Stuff 1

> Stuff 2

As opposed to if you do have the extra bracket:

Stuff 1

Continued stuff 1

> Stuff 1
> 
> Continued stuff 1

So, if you’re trying to echo that, you’ll need to have the >! in that line. :slight_smile:

Also, technically, no platform needs to change their standards (provided they’re not in conflict with another usage - so if || was used to denote something else in CM) - you can have customized ones for your own platform - Discord would just need to add the “official” version - not necessarily remove their current one.

1 Like

Oh! totalt forgot that CM has a different way to handle blockqoutes. But I agree