Skip to content

Instantly share code, notes, and snippets.

@yoyomonem
Last active July 4, 2023 12:00
Show Gist options
  • Save yoyomonem/308f8944384ede0c2936ffab62387431 to your computer and use it in GitHub Desktop.
Save yoyomonem/308f8944384ede0c2936ffab62387431 to your computer and use it in GitHub Desktop.
How to make spoilers in Markdown
<details>
<summary>spoiler name here</summary>
Spoiler text. Note that it's important to have a line break after the `<summary>` element, then you can add Markdown into the spoiler. Make sure to close it up with `</details>` afterwards.
```js
console.log("I'm a code block!");
```
</details>

Spoilers

Have a look at this spoiler.

Do you see something different from what HTML actually can do? Yes, that's right, I'm quite sure you understand this is a spoiler made with Markdown.

To fully understand, copy the placeholder code above into a Markdown file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment