Open guxiyuesi opened 5 months ago
` def markdown_to_html(content: str):
content = re.sub(
pattern=r"\$(.*?)\$",
repl=r"[$]\1[/$]",
string=content
)
# Only matches the contents of the Markdown image format ![]() enclosed by angle brackets < and >, without affecting other contents
content = re.sub(
pattern=r'<(!\[.*?\]\(.*?\))>',
repl=r'\1',
string=content
)
#Add line breaks before and after code blocks
content = re.sub(
pattern=r'(```\w*)',
repl=r'\n\1',
string=content
)
content = re.sub(
pattern=r'(\w*```)',
repl=r'\1\n',
string=content
)
# also need to load the mathjax and toc extensions
return markdown(content, extensions=['mdx_math', 'toc', 'fenced_code', 'tables'])
` 试一下下载源码,然后替换这个方法的内容,只能解决你的部分问题,不能解决全部问题。
os: win10 python: 3.8 chromedriver: 125 anki: QT5
工程为默认位置: [DB_CN] path = ./data_cn debug = False
[Anki_CN] front = ./templates/front-side.html back = ./templates/back-side.html css = ./templates/style.css output = ./data_cn/LeetCode.apkg
问题描述如下:
导入anki后, 在问题页中, 图片可以正常显示:
但回答页中, 图片不显示, 行内公式不渲染, 代码格式化不正确: