Is this a bug in the spoiler quote rendering?

I was writing this question about what Mordenkainen's main school of magic would be when I encountered a problem with how it was rendering spoiler quotes.

If I nest a blockquote (using the HTML <blockquote> tag) inside the spoiler quote, then any text after the nested blockquote is not hidden, even though it's still within the "spoiler area".

I'll show the bug here too:

This is a spoiler quote and is hidden.

This is a nested quote and is also hidden.
This should be hidden but is not.

I've also noticed the same issue on Meta Stack Exchange (see this answer).

Am I just doing something wrong, or has something changed, or is this simply a bug?

• It might be related to: Some improvements to blockquotes
– Rubiksmoose Mod
May 12 '20 at 14:55
• Spoilers: spoiler markdown is really buggy and has been for years without polish. :'( May 12 '20 at 14:59
• This has been reported on main Meta now: Line after blockquote in spoiler not a spoiler? and a dev has responded that is by design (and tagged it as such). I have tagged this question the same way.
– Rubiksmoose Mod
May 15 '20 at 14:19

After seeing the related Q&A on Main Meta (thanks to Rubiksmoose for finding it): Line after blockquote in spoiler not a spoiler?

I have solved the problem I was having by adding a <p> tag after the nested quote.

Specifically, what I had before (what I used in this meta question) is this:

>!This is a spoiler quote and is hidden.<blockquote>This is a nested quote and is also hidden.</blockquote>This should be hidden but is not.


But it works if it's changed to this:

>!This is a spoiler quote and is hidden.<blockquote>This is a nested quote and is also hidden.</blockquote><p>This should be hidden but is not.


This is another example of the above but with more line breaks and >! to make it clearer:

>!This is a spoiler quote and is hidden.
>!<blockquote>This is a nested quote and is also hidden.</blockquote>
>!This should be hidden but is not.


Which should be replaced by this:

>!This is a spoiler quote and is hidden.
>!<blockquote>This is a nested quote and is also hidden.</blockquote>
>!<p>This should be hidden but is not.


Either way, if you include that extra <p>, it renders it correctly like this:

This is a spoiler quote and is hidden.

This is a nested quote and is also hidden.

This should be hidden but is not.