From d7a90745f6e03cbbf65e4b5ae7d3b1af52430547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sun, 14 Dec 2025 08:33:01 +0300 Subject: [PATCH] correct invalid void tags --- app/lib/babycode.py | 8 ++++---- app/templates/guides/user-guides/99-babycode.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/lib/babycode.py b/app/lib/babycode.py index ea0eca6..91b6cda 100644 --- a/app/lib/babycode.py +++ b/app/lib/babycode.py @@ -6,7 +6,7 @@ from pygments.lexers import get_lexer_by_name from pygments.util import ClassNotFound as PygmentsClassNotFound import re -BABYCODE_VERSION = 7 +BABYCODE_VERSION = 8 class BabycodeError(Exception): pass @@ -441,15 +441,15 @@ RSS_TAGS = { VOID_TAGS = { 'lb': lambda attr: '[', 'rb': lambda attr: ']', - '@': lambda attr: '@', - '-': lambda attr: '-', + 'at': lambda attr: '@', + 'd': lambda attr: '-', } # [img] is considered block for the purposes of collapsing whitespace, # despite being potentially inline (since the resulting tag is inline, but creates a block container around itself and sibling images). # [code] has a special case in is_inline(). INLINE_TAGS = { - 'b', 'i', 's', 'u', 'color', 'big', 'small', 'url', 'lb', 'rb', '@' + 'b', 'i', 's', 'u', 'color', 'big', 'small', 'url', 'lb', 'rb', 'at', 'd' } def is_tag(e, tag=None): diff --git a/app/templates/guides/user-guides/99-babycode.html b/app/templates/guides/user-guides/99-babycode.html index 05d1d0e..ec538d7 100644 --- a/app/templates/guides/user-guides/99-babycode.html +++ b/app/templates/guides/user-guides/99-babycode.html @@ -126,7 +126,7 @@

Multiple images attached to a post can be clicked to open a dialog to view them.

-

Adding code blocks

+

Adding code blocūs

{% set code = 'func _ready() -> void:\n\tprint("hello world!")' %}

There are two kinds of code blocks recognized by babycode: inline and block. Inline code blocks do not break a paragraph. They can be added with [code]your code here[/code]. As long as there are no line breaks inside the code block, it is considered inline. If there are any, it will produce this:

{{ ('[code]%s[/code]' % code) | babycode | safe }} @@ -178,7 +178,7 @@

Void tags

-

The special void tags [lb], [rb], [-] and [@] will appear as the literal characters [, ], and @ respectively. Unlike other tags, they are self-contained and have no closing equivalent.

+

The special void tags [lb], [rb], [d] and [at] will appear as the literal characters [, ], -, and @ respectively. Unlike other tags, they are self-contained and have no closing equivalent.

{% endblock %}