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

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)"
},

View File

@@ -20,7 +20,14 @@
</body>
{{renderMathInElement}}
{{mermaid}}
<script>
setTimeout(()=>{
const KatexErrors=document.getElementsByClassName("katex-error")
for (const katexError of KatexErrors) {
katexError.innerHTML=katexError.title
}
},200)
</script>
<script>
mermaid.initialize({
securityLevel: 'loose',

View File

@@ -4,8 +4,11 @@ v1.2.3版 2025.8.22
优化
- 增加翻译稳定性ai返回结果出错时不会导致程序结束
- 增大mineru的并发上限
- 优化无法被解析的公式的显示效果
修复
- 修复agent连接池内存泄漏问题
- 修复部分markdown公式显示错误的问题
----------------------------------------
v1.2.2版 2025.8.20
特性