From 7db111d18b6381ef50ea5e55a9ea63e5a88b625c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Wed, 15 Apr 2026 03:15:31 +0300 Subject: [PATCH] make babycode [img] tags inline --- app/lib/babycode.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/lib/babycode.py b/app/lib/babycode.py index 85640c8..040f948 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 = 9 +BABYCODE_VERSION = 10 class BabycodeError(Exception): @@ -395,7 +395,7 @@ def tag_spoiler(children, attr): def tag_image(children, attr): img = f"\"{children}\"" - return f"
{img}
" + return img def tag_quote(children, attr): @@ -476,11 +476,8 @@ VOID_TAGS = { } -# [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', 'at', 'd' + 'b', 'i', 's', 'u', 'color', 'big', 'small', 'url', 'lb', 'rb', 'at', 'd', 'img' }