I discovered, while trying to edit a post using a spoiler block, that spoilers appear to interfere with Markdown heading syntax (hash(es) followed by text: # header), causing them to simply not render as a heading:

# This should be a heading

### This too

Blockquotes don't have this problem:

This should be a heading

This too

Using the HTML heading tags <hX> instead of Markdown syntax yields some odd spacing, lots of unnecessary space appears above the heading, though the text itself renders correctly:

This should be a heading

This too

I know spoiler blocks can be a bit... finicky, since they're a custom syntax for SE, and I found posts referencing that a reduced set of markdown was possibly supported inside them. I just still expected to be able to work around it by using the HTML equivalent, which also seems to be partially broken.

Is this a bug? Or is it a by-design thing?

Some previous references (direct and indirect) to this phenomenon:

  • 1
    See this too. Same problem at the end of the post. You have to use <h3> tags.
    – Ollie
    Oct 29 '20 at 23:46
  • This issue exists in the app, so I'm guessing it's been this way forever. Might check for an existing report.
    – Catija StaffMod
    Oct 29 '20 at 23:49
  • @Ollie Managed to find another, almost identical, post to your linked.
    – zcoop98
    Oct 29 '20 at 23:53
  • I've noticed this problem before...can't think why I didn't report it. The <h3> shortcut is a good one, though.
    – Ollie
    Oct 29 '20 at 23:57
  • @zcoop98 Yes, I've read that post before.
    – Ollie
    Oct 30 '20 at 0:21
  • Oops, sorry, didn't see your post edit. Deleting.
    – Ollie
    Oct 30 '20 at 1:00
  • See also: Embedding HTML in spoilers: meta.stackexchange.com/a/283598/282094
    – Rob
    Oct 30 '20 at 1:59
  • @Catija See above. It seems you're right; this has been an issue since 2011. Oct 30 '20 at 4:34
  • 3
    @SonictheK-DayHedgehog Considering the age of that question and the persistence of the problem, I hope this gets some priority now.
    – Mast
    Oct 30 '20 at 10:35
  • The <h1> doesn't create odd spacing: If you do the same to blockquotes, you'll see that it does the text with the --- underneath it, so it's not a bug.
    – Ollie
    Nov 5 '20 at 23:33
  • @Ollie I'm not sure what you mean, putting an <h1> tag does create strange spacing in spoilers- the spacing I'm referring to is above the heading itself. It creates lots of unnecessary extra space above the heading text inside the spoiler box, which doesn't happen in blockquotes.
    – zcoop98
    Nov 6 '20 at 16:01
  • @zcoop98 Sorry, it does create weird spacing - but that's because of the === and --- (I've been testing this in my About Me, so I'm not sure about accuracy). Although the whitespace (grayspace?) above the text does seem odd.
    – Ollie
    Nov 6 '20 at 17:46

Browse other questions tagged .