make babycode [img] tags inline
This commit is contained in:
@@ -6,7 +6,7 @@ from pygments.lexers import get_lexer_by_name
|
|||||||
from pygments.util import ClassNotFound as PygmentsClassNotFound
|
from pygments.util import ClassNotFound as PygmentsClassNotFound
|
||||||
import re
|
import re
|
||||||
|
|
||||||
BABYCODE_VERSION = 9
|
BABYCODE_VERSION = 10
|
||||||
|
|
||||||
|
|
||||||
class BabycodeError(Exception):
|
class BabycodeError(Exception):
|
||||||
@@ -395,7 +395,7 @@ def tag_spoiler(children, attr):
|
|||||||
|
|
||||||
def tag_image(children, attr):
|
def tag_image(children, attr):
|
||||||
img = f"<img class=\"post-image\" src=\"{attr}\" alt=\"{children}\">"
|
img = f"<img class=\"post-image\" src=\"{attr}\" alt=\"{children}\">"
|
||||||
return f"<div class=post-img-container>{img}</div>"
|
return img
|
||||||
|
|
||||||
|
|
||||||
def tag_quote(children, attr):
|
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 <img> tag is inline, but creates a block container around itself and sibling images).
|
|
||||||
# [code] has a special case in is_inline().
|
|
||||||
INLINE_TAGS = {
|
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'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user