Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 大纲字号不应该跟随字体设置 Fix https://github.com/siyuan-note/siyuan/issues/7202

Liang Ding1d83eada71c5
diff --git a/kernel/model/render.go b/kernel/model/render.go
index 54f805393b..73047513c5 100644
--- a/kernel/model/render.go
+++ b/kernel/model/render.go
@@ -18,6 +18,7 @@ package model
import (
"bytes"
+ "regexp"
"strings"
"github.com/88250/gulu"
@@ -46,6 +47,14 @@ func renderOutline(node *ast.Node, luteEngine *lute.Lute) (ret string) {
if !entering {
return ast.WalkContinue
}
+
+ if style := n.IALAttr("style"); "" != style {
+ if strings.Contains(style, "font-size") { // 大纲字号不应该跟随字体设置 https://github.com/siyuan-note/siyuan/issues/7202
+ style = regexp.MustCompile("font-size:.*?;").ReplaceAllString(style, "font-size: inherit;")
+ n.SetIALAttr("style", style)
+ }
+ }
+
switch n.Type {
case ast.NodeText, ast.NodeLinkText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
tokens := html.EscapeHTML(n.Tokens)