mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 大纲字号不应该跟随字体设置 Fix https://github.com/siyuan-note/siyuan/issues/7202
This commit is contained in:
parent
70fc27012f
commit
1d83eada71
1 changed files with 9 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
|
|
@ -46,6 +47,14 @@ func renderOutline(node *ast.Node, luteEngine *lute.Lute) (ret string) {
|
||||||
if !entering {
|
if !entering {
|
||||||
return ast.WalkContinue
|
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 {
|
switch n.Type {
|
||||||
case ast.NodeText, ast.NodeLinkText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
|
case ast.NodeText, ast.NodeLinkText, ast.NodeCodeBlockCode, ast.NodeMathBlockContent:
|
||||||
tokens := html.EscapeHTML(n.Tokens)
|
tokens := html.EscapeHTML(n.Tokens)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue