修复markdown图片缺失问题

This commit is contained in:
xunbu
2025-11-25 12:47:27 +08:00
parent bbf34762ab
commit 8cc903813b
5 changed files with 110 additions and 41 deletions

View File

@@ -81,7 +81,7 @@ def placeholder2uris(markdown: str, mask_dict: MaskDict):
print(f"占位符<ph-{id}>已还原为图片")
return uri
ph_pattern = r"<ph-([a-zA-Z0-9]+)>"
ph_pattern = r"<\s*[pP][hH]\s*-\s*([a-zA-Z0-9]+)\s*>"
markdown = re.sub(ph_pattern, placeholder2uri, markdown)
return markdown