You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`
def markdown_to_html(content: str):
# replace the math symbol "$x$" to "[$]x[/$]" to make it compatible with mathjax
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后, 在问题页中, 图片可以正常显示:
但回答页中, 图片不显示, 行内公式不渲染, 代码格式化不正确:
The text was updated successfully, but these errors were encountered: