Spoiler warning
Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.
console.log("I'm a code block!");<details>
<summary>Spoiler warning</summary>
Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the `<details>` tag... just make sure you close `<details>` afterward.
```javascript
console.log("I'm a code block!");
```
</details>
Spacing Issue Resolved?
FYI ... I think that the space thing has largely been resolved ... as I've used these in lists (both ordered and unordered) in the past. ๐
I think it is only required if you are including markdown inside the spoiler.
I accept that this may have been the whole purpose of this gist, given the title, but ... just thought I'd mention it.
If you wish to see my suggested usage, see the 'How To' section, below.
You could very easily use the below to put spoilers in a list like this:
One - There's more if you tap me ...
See? You can even include more code:<details>... just make sure you close</details>afterward.Two - There's more if you tap me, too ...
See?Three - This one has layers, heh ...
Not here, silly ...A - I'm helping ...
Like RalphB - You're not, you suck ...
I mean, harsh ... but fair ...C - Why are any of us here?
42Four - I'm just here to wrap ...
... things up!I've included all sorts in spoilers, purely as a way to include as much information as possible without polluting the main point of a post, issue, reply, whatever. ๐
How To
Working with the example above ...
Visual
Spoiler warning
Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the<details>... just make sure you close</details>afterward.Code