correct invalid void tags

This commit is contained in:
2025-12-14 08:33:01 +03:00
parent d90b4643cb
commit d7a90745f6
2 changed files with 8 additions and 8 deletions

View File

@@ -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 <img> 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):