FYI, you can have Discourse do this for you. Highlight a block of text, click the gear up next to the emoji thing, and then click “Hide Details”. Or if you wanna do it manually:
[details="Text to display, like SPOILER ALERT!"]
Some more text stuff here that spoils everything for everyone.