feat: 新增网页解析类,优化依赖及图片编码支持

This commit is contained in:
begoniezhao
2025-11-17 17:08:20 +08:00
committed by lyingbug
parent 2d66abedf0
commit 4fdbec17a7
5 changed files with 161 additions and 64 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
class MarkdownImageUtil:
def __init__(self):
self.b64_pattern = re.compile(
r"!\[([^\]]*)\]\(data:image/(\w+);base64,([^\)]+)\)"
r"!\[([^\]]*)\]\(data:image/(\w+)\+?\w*;base64,([^\)]+)\)"
)
self.image_pattern = re.compile(r"!\[([^\]]*)\]\(([^)]+)\)")
self.replace_pattern = re.compile(r"!\[([^\]]*)\]\(([^)]+)\)")