unescape children of babycode elements

This commit is contained in:
2025-08-17 15:15:49 +03:00
parent 6dd9f5bf65
commit 751be27b52

View File

@ -1,5 +1,5 @@
from .babycode_parser import Parser
from markupsafe import escape
from markupsafe import Markup, escape
import re
BABYCODE_VERSION = 3
@ -241,7 +241,7 @@ def babycode_to_html(s):
element['children'][i + 1] if i+1 < len(element['children']) else None
)
_nobr = element['name'] == "code" or element['name'] == "ul" or element['name'] == "ol"
c = c + fold(child, _nobr, _surrounding)
c = c + Markup(fold(child, _nobr, _surrounding))
res = TAGS[element['name']](c, element['attr'], surrounding)
return res
case "link":