add spoiler tag to babycode

This commit is contained in:
2025-08-16 05:28:53 +03:00
parent cf4bf3caa3
commit 14b96bf37e
6 changed files with 49 additions and 5 deletions

View File

@ -151,6 +151,14 @@
Will produce the following list:
{{ list | babycode | safe }}
</section>
<section class="babycode-guide-section">
<h2 id="spoilers">Spoilers</h2>
{% set spoiler = "[spoiler]My hidden content[/spoiler]" %}
<p>You can make a section collapsible by using the <code class="inline-code">[spoiler]</code> tag:</p>
{{ ("[code]\n%s[/code]" % spoiler) | babycode | safe }}
Will produce:
{{ spoiler | babycode | safe }}
</section>
{% endset %}
{{ sections | safe }}
</div>