On the topic of pasting code snippets into Discourse threads, you can also use “details” blocks for things that contain spoilers.
So, if you’re helping someone out, you can give a hint and still collapse the solution:
<details>
<summary>Spoiler Alert!</summary>
This text will be hidden...
</details>
This is what the results will look like:
Spoiler Alert!
This text will be hidden…