Fix memoir image delivery and Android rendering
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
PLACEHOLDER_RE = re.compile(r"\{\{\{\{IMAGE:(.*?)\}\}\}\}")
|
||||
PLACEHOLDER_RE = re.compile(
|
||||
r"\{\{\{\{IMAGE:(.*?)\}\}\}\}|\{\{IMAGE:(.*?)\}\}",
|
||||
re.DOTALL,
|
||||
)
|
||||
|
||||
|
||||
def parse_image_placeholders(content: str, max_images: int) -> list[dict[str, Any]]:
|
||||
items: list[dict[str, Any]] = []
|
||||
for match in PLACEHOLDER_RE.finditer(content or ""):
|
||||
description = match.group(1).strip()
|
||||
description = (match.group(1) or match.group(2) or "").strip()
|
||||
if not description:
|
||||
continue
|
||||
items.append(
|
||||
|
||||
Reference in New Issue
Block a user