In Discourse 1.8.0.beta13, the [details=Spoiler]This should be hidden[details] logic doesn’t work if it’s embedded in a paragraph. It does work if it’s separated by a newline. The problem appears to be in the generated html, as it’s reproducible in Chrome, Firefox, and Safari.
details tag with proceeding newline
This text is hidden until you click the text.
Here’s an embedded [details=details tag embedded]This text shows up all the time in the page, but the preview makes it looks like it works.[/details] paragraph.
Why does the preview have the expected behavior, then? One would expect that and the rendered version to act the same.
Using [details] for spoilers and not knowing this buggy behavior means you think you left a properly hidden spoiler when in fact you didn’t. This has been super aggravating, confusing, and unexpected for myself and friends on another discourse instance.
I think this is a real bug here. The [details] tag renders differently in preview than in the cooked post. I’ve experienced it myself. I’ve also had to try and explain to my users why something looks OK in preview but fails once posted.