mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 18:54:21 +01:00
🎨 Support KaTex macro parameters https://github.com/siyuan-note/siyuan/issues/11448
This commit is contained in:
parent
34a487b2d0
commit
491a1696c1
2 changed files with 45 additions and 0 deletions
|
|
@ -1962,6 +1962,16 @@ func processKaTexMacros(n *ast.Node) {
|
|||
depth := 1
|
||||
expanded := resolveKaTexMacro(usedMacro, ¯os, &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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue