How to use spoilers to create hidden collapsible text in BBCode & Formatting Knowledge Base | World Anvil

How to use spoilers to create hidden collapsible text

Hiding parts of your content while letting your readers reveal them can be really useful. You can use it for spoilers, but also to better structure your article content or even gamify it with a quiz. On World Anvil, this is done with a button that can reveal and hide content. This is how to create it!

 
  1. Write the text you want to hide and wrap in with the spoiler tags. For example: [spoiler]This text will be hidden by default[/spoiler].
  2. The button will say "Show spoiler" by default, but you can change it. To do so, type a pipe character (|) at the end of the text followed by the button label. For example: [spoiler]This text will be hidden by default|Click to reveal[/spoiler].
 

Take a look at these two examples:

 
[spoiler]This text will be hidden by default[/spoiler]
Show spoiler
This text will be hidden by default
[spoiler]This text will be hidden by default|Click to reveal[/spoiler]
Click to reveal
This text will be hidden by default