5

The spoiler markdown is sometimes cough messed up. Today's edition: Spoiler doesn't work with numbered lists.

>! 1. Foo
   2. Bar
   3. Baz

renders like

! 1. Foo 2. Bar 3. Baz

I could instead do

>! 1. Foo
>! 2. Bar
>! 3. Baz

but that also turns into

1. Foo 2. Bar 3. Baz

Sheesh, it's ugly! I could also insert two spaces in the second version and get "bar" and "baz" in new lines, but that's still not proper or enough indentation.

Can this be fixed please? Are there any good and un-ugly workarounds? (preferably using markdown)

8
  • 1
    To expand on this, they don't currently parse any other block elements inside them. This includes headers, blockquotes, code blocks, and horizontal rules in addition to the lists.
    – animuson StaffMod
    Sep 17, 2015 at 17:28
  • 1
    Also please consider the possibility that you're hiding too much.
    – jscs
    Sep 17, 2015 at 17:31
  • And sometimes mathjax breaks too if i recall correctly. Sep 17, 2015 at 17:33
  • @Josh we need it to hide a chemistry homework answer; recommended formatting is spoiler, but it's not necessary.
    – M.A.R.
    Sep 17, 2015 at 18:39
  • Awww, maaan…I was four paragraphs into a lengthy question about this very matter. Sep 19, 2015 at 1:53
  • @JoshCaswell What if the post is just one long list of answers, with brief explanations for each answer on the same line? Sep 19, 2015 at 1:55
  • Why are you hiding the text from the question, @BlacklightShining?!
    – jscs
    Sep 19, 2015 at 3:54
  • @JoshCaswell …I didn't think of that. Now that you mention it, though, I can't figure out how to spoiler just the answer on each line. Sep 19, 2015 at 5:07

2 Answers 2

4

Spoilers don't work at the Markdown level. You cannot use any block-level Markdown constructs with it.

How it works is that there's a postprocessor that looks for <blockquote> tags where each line starts with !. Such <blockquote>s get a spoiler class added. That's it.

And because of the !-at-start-of-each-line check, you cannot possibly have other block-level Markdown constructs within, such as code blocks, lists, etc. You can use manual HTML, though:

  1. Test item 1
  2. Test item 2

3

Well, unless the list itself is spoiler, you can hide each item on its own:

1. >!Foo
1. >!Bar
1. >!Baz

Which turns into:

  1. Foo

  2. Bar

  3. Baz

1

You must log in to answer this question.

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