Skip to content

Instantly share code, notes, and snippets.

@lgg
Forked from jbsulli/GitHub spoiler markdown.md
Created June 30, 2022 12:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lgg/8b8ab744e11221f0b585e15b11c90356 to your computer and use it in GitHub Desktop.
Save lgg/8b8ab744e11221f0b585e15b11c90356 to your computer and use it in GitHub Desktop.

Demo:

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!");

How to:

<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>

Credits:

dear-github/dear-github#166

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