13
>! This is a spoiler.
>! A multi-line spoiler.
>! It works, as a spoiler, but it is not properly formatted as a multi-line spoiler.

This is a spoiler. A multi-line spoiler. It works, as a spoiler, but it is not properly formatted as a multi-line spoiler.


>! Let's try again.

>! Maybe this will work.

>! No, it doesn't!

! Let's try again.

! Maybe this will work.

! No, it doesn't!


>!This is a workaround.
>!<p>Sadly, it requires typing lots of p tags, although the first and last lines do not require them.</p>
>!Is there a better way?

This is a workaround.

Sadly, it requires typing lots of p tags, although the first and last lines do not require them.

Is there a better way?

  • 3
    You can use <br> tags instead or paragraphs – Cai Sep 27 '16 at 13:48
3

There is a much, much simpler way of this.

>! First line... <br> Second line... <br> Third line... <br> I think you understand this now `

First line...
Second line...
Third line...
I think you understand this now

<br> is used for creating a newline basically within a single line. In this case, the <br> brings all the text after it into the next line and covers the text since it is technically in the line with the spoiler tag. Consecutive <br> will create more and more lines. This tag is commonly used to formatting text is a specific way like a puzzle:

Do you
now know
how to make
multi-lined spoilers
without a line
between each line of text?

| improve this answer | |
18

You can do it in a better way:

  • add two spaces in the end of the line for line-break
  • add >! with two spaces in the new line for the line break with in spoiler.

Sample content as:

>! This is a spoiler.  
>!  
>! A multi-line spoiler.  
>!  
>! It works, as a spoiler, but it is not properly formatted as a multi-line spoiler.

This is a spoiler.

A multi-line spoiler.

It works, as a spoiler, but it is not properly formatted as a multi-line spoiler.

| improve this answer | |
3

<p> tags don't need closing tags in HTML5 if they're followed by other <p> tags, so you can shorten things a bit:

>!1<p>2<p>3<p>4<p>5

1

2

3

4

5

rather than

>!1<p>2</p><p>3</p><p>4</p>5

1

2

3

4

5

As this involves less typing than even <br> tags, and introduces real paragraphs to boot, this is probably the best you're going to get.

| improve this answer | |
1

If the multi-line spoiler contains a code block (for example to format a data table), a hack to make a multiline spoiler work:

>!<code>line 1</code>    
>!<code>line 2</code>    
>!<code>line 3</code>

Produces

line 1
line 2
line 3

Note: The four ASCII spaces after every line but the last are required.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .