Skip to content

Instantly share code, notes, and snippets.

@CraftedRO
Forked from jbsulli/GitHub spoiler markdown.md
Last active May 15, 2024 18:09
Show Gist options
  • Save CraftedRO/72172f545ceae2daecb6bb7e4a265bad to your computer and use it in GitHub Desktop.
Save CraftedRO/72172f545ceae2daecb6bb7e4a265bad 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

https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

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