From d0b702e1e8105905bbc954362e2177256d4a5dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sat, 16 Aug 2025 05:40:48 +0300 Subject: [PATCH] allow spaces in babycode tag attrs --- app/lib/babycode_parser.py | 2 +- app/templates/babycode.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/babycode_parser.py b/app/lib/babycode_parser.py index 84a236a..f05dd7e 100644 --- a/app/lib/babycode_parser.py +++ b/app/lib/babycode_parser.py @@ -4,7 +4,7 @@ import re PAT_EMOTE = r"[^\s:]" PAT_BBCODE_TAG = r"\w" -PAT_BBCODE_ATTR = r"[^\s\]]" +PAT_BBCODE_ATTR = r"[^\]]" PAT_LINK = r"https?:\/\/[\w\-_.?:\/=&~@#%]+[\w\-\/]" class Parser: diff --git a/app/templates/babycode.html b/app/templates/babycode.html index 3b67dc6..fdd7f3c 100644 --- a/app/templates/babycode.html +++ b/app/templates/babycode.html @@ -153,7 +153,7 @@

Spoilers

- {% set spoiler = "[spoiler]My hidden content[/spoiler]" %} + {% set spoiler = "[spoiler=My spoiler tag]My hidden content[/spoiler]" %}

You can make a section collapsible by using the [spoiler] tag:

{{ ("[code]\n%s[/code]" % spoiler) | babycode | safe }} Will produce: