# Is there any way we can improve the spoiler formatting?

The spoiler line is great for hiding text:

If you edit this post, you can see the ways I tried to use the spoiler formatting which produced the fails.

But it can be difficult to use sometimes.

! Maybe I want to have multiple chunks hidden in a row

! Well nope, does not work like that

You have to include non-blocked text between two things in spoiler hiders

That non-block text above made me exist!!!

Well that's a simple fix right?

! Just put all the text in one block. Put a return at the end of a line and indent the next paragraph with some spaces. Ahhh, if only it worked that way, then that's what we would do.

But it doesn't, so we have to talk

like

this

.

Does anyone know why the spoilers behave this way, and is there anything we can do to make them function as blocks?

Edit: Based upon Koa's answer and ABCdexter's question, I started testing what things work in a spoiler.

Bold
Italic
$\frac{a}{b}$

• and we need better formatting in spoilers, like bullet point – Fabich Jun 4 '16 at 0:50
• Yesterday, I was using the stackexchange android app and faced a lot of trouble using the spoilers. Apparently, the bold and italics also don't work in the spoiler, correct me if i'm wrong. – ABcDexter Jun 4 '16 at 11:43
• @ABcDexter I was able to put bold and italics in. Look at edit. – Tony Ruth Jun 5 '16 at 19:12
• You might want to see my answer here for more info on using spoilers. – GentlePurpleRain Jun 7 '16 at 16:30
• One comment. Is there any way to get spoiler in the top margin of the answer box page (similiar to link / quote / code / image icons)? That would be way helpful. – zipzit Jun 8 '16 at 22:20
• @zipzit yes, this would be a great addition. I see that it is possible for me to select a block of text and click bold and that it inserts *s in the right places. It should also be possible to create a button where you select a block of text and click spoiler. It would add ">!" to the beginning of every line and " "(two spaces) to the end of every line. – Tony Ruth Jun 9 '16 at 18:15
• @TonyRuth Yes, exactly. Right now you have to remember to choose Quotation when you highlight the text, and then add the ! to each line. That's not intuitive at all. A click would be SO much easier. – zipzit Jun 9 '16 at 19:45
• @zipzit It would be a feature request, but since spoilers are rarely used on most SE sites (except: Puzzling and Movies & TV) I imagine it would see little push. – Jonathan Allan Jun 14 '16 at 2:23

Spoilers totally work with multiple lines:

Just
have
two

spaces
after
each
line

Also, you need to add a new >! at the start of every line.

>! This shows up
>! as a multi line spoiler.
>! Like breaks
>! Are a double empty space
>!
>! Like that.

This shows up
as a multi line spoiler.
Like breaks
Are a double empty space

Like that.

If you need two spoilers with no text in between
>! Do

<! >
>!this

Do

this

For code blocks in spoilers
>! Do something<pre><code>like ...
>!this</code></pre>

Do something

like       ...
this

Aligned equations must be on one line though
>! Like so\begin{align}f(x)&=0&\text{if }&x\neq 0\\&=1&&x=0\\\end{align}

Like so\begin{align}f(x)&=0&\text{if }&x\neq 0\\&=1&&x=0\\\end{align}

• He's not referring to multi-lines, though, Koa. He's looking at multi-line spoilers with a linebreak in between. For some, odd, reason, this doesn't work and disables spoilers, entirely. For example, a line break after "up" will break yours. – Khale_Kitha Jun 4 '16 at 7:14
• @Khale_Kitha I updated it to show how to enter line breaks. Sure, not having to do it this way would be nice, but it's not the end of the world. – KoA Jun 4 '16 at 7:42
• This is definitely useful thanks. – Tony Ruth Jun 5 '16 at 5:11
• Note that you can also separate two spoiler blocks without putting text in between them by adding an empty HTML comment between the two blocks: <!-- -->. This results in a small amount of whitespace between the two spoiler blocks. – GentlePurpleRain Jun 6 '16 at 15:00
• @GentlePurpleRain Could be useful to add this as "Tipp" to this post – BmyGuest Jun 7 '16 at 6:53
• @BmyGuest I made a new answer. – GentlePurpleRain Jun 7 '16 at 16:43
• Maybe I'm being mean, but isn't double-tapping a common knowledge across SE? – InitializeSahib Jun 12 '16 at 0:44
• @SahibPrime Spoilers are used way more on Puzzling than anywhere else, and are more often used for entire paragraphs including various formatting. In most other places, they are used for a single plain text word or phrase, so a lot of this stuff is moot. – GentlePurpleRain Jun 14 '16 at 16:51
• @GentlePurpleRain Oh, I see. Thank you! – InitializeSahib Jun 14 '16 at 17:05
• Can this please be added to meta.puzzling.stackexchange.com/editing-help? As a new user to this site I had great difficulty getting my spoiler tags to work as I wanted them to and the help page suggested by the editor wasn't helpful. – niemiro Jun 16 '16 at 10:48

Separate lines with  \n>! like this:

>!Line 1
>!Line 2
>!Line 3
Note that these are:

>!Line 1   <------- TWO SPACES
>!Line 2   <------- TWO SPACES
>!Line 3       <---------  NO SPACES

Line 1
Line 2
Line 3

If you want to have multi-line spoilers

with a linebreak in between them,

you can use a blank line, a line containing just &nbsp;, and another blank line

• Well, nope. Too bad this is not "Multi-iine Spoilers". This is just single-line spoilers separated by \n\n \n\n. – EKons Jun 7 '16 at 17:02