Folding spoilers


(NomNuggetNom ) #1

I think folding spoilers should be implemented using existing HTML presentation:

Spoiler TitleSpoiler Contents

Which can be achieved like this:

<details><summary>Spoiler Title</summary>Spoiler Contents</details>

Note: This requires all inside elements to be HTML, and would need to be fixed. All markdown inside of it is broken. Obviously this isn’t user friendly. I saw it suggested something like this:

[spoiler "Spoiler Title"]Spoiler Content[/spoiler]


Spoiler bbcode - html code
(Jeff Atwood) #2

We already have spoilers via [spoiler][/spoiler]

This is a spoiler

What else are you proposing?


Spoiler tag not working with CDN and CORS
(NomNuggetNom ) #3

With large blocks of text, this doesn’t do anything very helpful. On many forum systems, spoilers exist to make enormous amounts of information accessible but not in the way. It’s crucial to have folding spoilers to make threads readable.

Perhaps it should be renamed “detail” or something else.
[detail "Title"]Detail content[/detail]

However, Markdown should still work in the “Title” area, for images and stuff.


(Jacob) #4

I’ve had this requested on my board as well, would love a separate spoiler option that worked like this.


(Greg Swallow) #5

One of the wordpress themes I use has a feature like this, they call it “toggle text”:
http://www.gavick.com/demo/wordpress/meetgavernwp/?p=207
(about 3/4 of the way down the page)

It’s used like this:

[toggle header="Header text"]Toggled text[/toggle]

(Bill Ayakatubby) #6

Linking discussions:


(Sander Datema) #7

Spoiler tags were used because they folded the text, but only because nothing else was available. Discourse has a spoiler tag and it should be used for that.

I like the idea of a separate toggle for large texts that should be temporarily hidden. However, in my opinion this is plugin territory.


(NomNuggetNom ) #8

I don’t think it should be “plugin territory.” Many forum systems consider folding spoilers essentials because they are so useful.


(Jeff Atwood) #9

Nothing about folding is really spoiler specific though, you could want to hide sections in a giant FAQ for readability, etc.


(NomNuggetNom ) #10

Sure, then it just shouldn’t be called a “spoiler” as others have mentioned.


(Jeff Atwood) #11

It is a different feature altogether is my point. Two different things. That can coexist.


(NomNuggetNom ) #12

Absolutely! I’m not suggesting a replacement of the current spoilers, sorry if that’s how it appeared.


(Jeff Atwood) #14

Details html tag is now supported out of the box for your folding pleasures.


(Anton) #15

Folding spoilers do not open in preview panel - is it intentional or a bug?

I mean this code from the very first message:

<details><summary>Spoiler Title</summary>Spoiler Contents</details>

(Marcus Ottosson) #16

I would also have expected them to work in the preview, any update on this?


(Jeff Atwood) #17