allow spaces in babycode tag attrs

This commit is contained in:
2025-08-16 05:40:48 +03:00
parent 14b96bf37e
commit d0b702e1e8
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import re
PAT_EMOTE = r"[^\s:]" PAT_EMOTE = r"[^\s:]"
PAT_BBCODE_TAG = r"\w" PAT_BBCODE_TAG = r"\w"
PAT_BBCODE_ATTR = r"[^\s\]]" PAT_BBCODE_ATTR = r"[^\]]"
PAT_LINK = r"https?:\/\/[\w\-_.?:\/=&~@#%]+[\w\-\/]" PAT_LINK = r"https?:\/\/[\w\-_.?:\/=&~@#%]+[\w\-\/]"
class Parser: class Parser:

View File

@ -153,7 +153,7 @@
</section> </section>
<section class="babycode-guide-section"> <section class="babycode-guide-section">
<h2 id="spoilers">Spoilers</h2> <h2 id="spoilers">Spoilers</h2>
{% set spoiler = "[spoiler]My hidden content[/spoiler]" %} {% set spoiler = "[spoiler=My spoiler tag]My hidden content[/spoiler]" %}
<p>You can make a section collapsible by using the <code class="inline-code">[spoiler]</code> tag:</p> <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 }} {{ ("[code]\n%s[/code]" % spoiler) | babycode | safe }}
Will produce: Will produce: