新增mineru部署converter

This commit is contained in:
xunbu
2025-11-04 16:54:33 +08:00
parent a9e47ce0da
commit 534a71c67b
5 changed files with 148 additions and 25 deletions

View File

@@ -64,6 +64,7 @@ def uris2placeholder(markdown: str, mask_dict: MaskDict):
# 整个图片都替换为占位符
mask_dict.set(id, match.group())
print(f"生成占位符<ph-{id}>")
return f"<ph-{id}>"
uri_pattern = r'(!\[.*?\])\((.*?)\)'
@@ -77,6 +78,7 @@ def placeholder2uris(markdown: str, mask_dict: MaskDict):
uri = mask_dict.get(id)
if uri is None:
return match.group()
print(f"占位符<ph-{id}>已还原为图片")
return uri
ph_pattern = r"<ph-([a-zA-Z0-9]+)>"