8
\$\begingroup\$

See https://rpg.stackexchange.com/a/74047/23970: Korvin and I think we've got everything right, but the spoiler hide/reveal text feature isn't working.

\$\endgroup\$
10
\$\begingroup\$

Yes, they're broken. They've been broken in this particular way for a couple of years now. There's no neat workaround. One spoiler paragraph sitting in lonely isolation is always fine, but combining them isn't so easy.

What you did to break it (aka what to avoid)

Your problem was that you wrote out two adjacent paragraphs:

>! one paragraph

>! another paragraph

which looks like this:

! one paragraph

! another paragraph

That break between the paragraphs messes up spoiler quotes.

Fixing it

The way to patch it up & retain roughly the same intended appearance is to break up the paragraphs manually:

>! first paragraph can be left as-is
>! <p>other paragraphs need a `<p>` element at the start
>! <p>another paragraph
>!
>! <p>if you want to separate your paragraph lines in your editing, still use a `>!` on the empty lines like above.

which looks like this:

first paragraph can be left as-is

other paragraphs need a <p> element at the start

another paragraph

if you want to separate your paragraph lines in your editing, still use a >! on the empty lines like above.

or to divide the spoiler paragraphs completely:

>! one paragraph

<!-- -->

>! another paragraph

which gives you this:

one paragraph

another paragraph

The <!-- --> is an empty HTML comment. <!-- You leave comments in HTML like this. -->. The extra line breaks around the comment aren't important for the comment's sake. You can leave those literally anywhere and they're totally invisible, there's one in the middle of this sentence. You do at least need a line break above the comment to split the spoiler quotes. The line break after is optional but to me things look neater with it.

\$\endgroup\$
  • 2
    \$\begingroup\$ Grateful for the tip as my other uses of spoiler worked as advertised. \$\endgroup\$ – KorvinStarmast Feb 1 '16 at 14:22
  • \$\begingroup\$ so should my question be marked as a duplicate? \$\endgroup\$ – nitsua60 Feb 1 '16 at 16:54
  • 1
    \$\begingroup\$ If you’re going to use HTML, using proper <p> tags is preferable to manual line breaks with <br>. It makes little difference in a traditional browser, but might make a significant difference in alternative contexts, especially screenreaders for the blind. \$\endgroup\$ – KRyan Feb 1 '16 at 20:36
  • \$\begingroup\$ @KRyan I've updated with that. Incidentally, using those with HTML5's policy that <p> elements don't need to be closed gives us the neatest possible output and formatting. \$\endgroup\$ – doppelgreener Apr 8 '16 at 8:38
  • \$\begingroup\$ Is there a way to divulge this information on the Markdown Editing Help page? \$\endgroup\$ – DaFluid Apr 8 '16 at 8:50
  • 2
    \$\begingroup\$ @DaFluid That's maintained by SE Staff, and it's the same across all stacks. This breakage has been around for at least 3½ years at this point without resolution. \$\endgroup\$ – doppelgreener Apr 8 '16 at 9:08

You must log in to answer this question.

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