This commit is contained in:
Daniel 2024-05-18 00:05:23 +08:00
parent 34a487b2d0
commit 491a1696c1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 45 additions and 0 deletions

View file

@ -1962,6 +1962,16 @@ func processKaTexMacros(n *ast.Node) {
depth := 1
expanded := resolveKaTexMacro(usedMacro, &macros, &keys, &depth)
expanded = unescapeKaTexSupportedFunctions(expanded)
idx := strings.Index(mathContent, usedMacro)
if idx < 0 {
continue
}
// 处理宏参数
fillKaTexMacrosParams(usedMacro, &mathContent, &expanded)
// 将宏展开替换到 mathContent 中
mathContent = strings.ReplaceAll(mathContent, usedMacro, expanded)
}
mathContent = unescapeKaTexSupportedFunctions(mathContent)