优化无法被解析公式的显示效果

This commit is contained in:
xunbu
2025-08-22 14:49:48 +08:00
parent 5bcd4d335e
commit 1144dd6899
3 changed files with 13 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ class MD2HTMLExporter(MDExporter):
# 这是正确且推荐的 JS 配置,它与 pymdownx.arithmatex 配合工作
# 它只寻找 arithmatex 生成的 \(...\) 和 \[...\]
# language=javascript
render_math_in_element = r"""
<script>
document.addEventListener("DOMContentLoaded", function () {
@@ -39,7 +40,7 @@ class MD2HTMLExporter(MDExporter):
{left: '\\(', right: '\\)', display: false}
],
throwOnError: false,
errorColor: '#cc0000',
errorColor: '#F5CF27',
macros: {
"\\f": "#1f(#2)"
},