11

This comment (last parts) seems to be explaining everything:

(...) it seems, that anti-spoiler can hide only one-line sentence. Breaking sentences into more than one line or trying to hide lists produces a very strange and not looking good effect.

Is it possible to use anti-spoiler tag (>!) to hide a list or block of text? Or what am I doing wrong?

I tried both with unordered list and with "converting" it into multi-line block of text, replacing "dots" with "a)", "b)", "c)" etc. All for nothing -- any attempt, that I undertook ended in converting multi-line block of text or list into single line (hidden behind anti-spoiler).

What am I missing?

  • 1
  • My guess is that you used a carriage return to move down to the next line, rather than using the correct markdown (a double-space at the end of the line). – Valorum Feb 17 '16 at 19:50
  • 2
    Oh, please don't encourage people further to put their entire question into a spoiler block. This won't end well on the long run. You know why they work crap with paragraphs and structures? Because you ought to use them sparingly. ;-) – TARS Feb 18 '16 at 13:32
  • I struggled with similar formatting problems when I wrote scifi.stackexchange.com/q/96701/4918 – b_jonas Feb 23 '16 at 13:26
14

You have to use HTML tags.

I’m not quite sure why the regular Markdown formatting works in blockquotes but not in spoiler blocks; I dug into it a while back but never got very far with it. The limited subset of HTML supported by SE mostly just works in spoiler blocks.

Examples:

  • For linebreaks, use <br>:

    >! This is a spoiler block <br> with multiple lines <br> of text
    

    This is a spoiler block
    with multiple lines
    of text

  • For paragraphs, use a double <br>:

    >! My first paragraph. <br><br> Another paragraph. Such words.
    

    My first paragraph.

    Another paragraph. Such words.

    I have used <p> and </p> tags in the past, although I have a vague recollection that it broke some spoiler markup on mobile.

  • For lists, use <ul> and <ol>.

    >! My example list has
    >! <ol>
    >! <li>a first item</li>
    >! <li>and another item</li>
    >! <li>and a final item</li>
    >! </ol>
    

    My example list has

    1. a first item
    2. and another item
    3. and a final item

5

@alexwlchan's answer gives one nice solution, but you don't necessarily have to use HTML tags for linebreaks and paragraphs. It's enough to put two spaces at the end of each line, like this:

>! one line  
>! another line  
>!  
>! after a blank line

which yields the following output:

one line
another line

after a blank line

However, this doesn't work to give bulletpoints or list formatting within a spoiler block, for which see Alex's answer.


On a related note, to get get separate spoiler blocks with nothing in between use either <nbsp/> or <!-- ---> in between the two blocks.

>! one spoiler  

  <nbsp/>

>! another spoiler.

yields

one spoiler

another spoiler.

You must log in to answer this question.

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