For the CodeCombat forum, we have a lot of players posting their code to solve our levels. It would be great if we could use [spoiler] tags so that they aren’t giving away the answers to players who don’t want to see. It works with single line code:
[spoiler]`var singleLineCode = "some code";`[/spoiler]
var singleLineCode = "some code";
Edit: actually, I don’t know why I missed this, but it doesn’t work on single-line code either (no code formatting).
But indenting by four spaces on multiline code doesn’t work (the spoiler works, but not code formatting):
var multiLineCode = "some code with no code formatting"; while (true) multilineCode += "some more code, wish it looked like code";
Surrounding with triple backticks (our preferred method) makes code formatting work, but breaks the spoiler:
var multiLineCode = "some code that should be spoiled"; while (true) multilineCode += "some more code, you can't unsee it";
Would love it if the spoiler tag could support code blocks!