🎨 Database index content/markdown values no longer contain zero-width spaces https://github.com/siyuan-note/siyuan/issues/15204

This commit is contained in:
Daniel 2025-07-03 10:01:04 +08:00
parent 2673ae343f
commit 286223db84
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 12 additions and 0 deletions

View file

@ -36,6 +36,7 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/88250/lute/editor"
"github.com/88250/lute/html"
"github.com/88250/lute/parse"
"github.com/mattn/go-sqlite3"
@ -867,6 +868,11 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
length = utf8.RuneCountInString(content)
}
// 剔除零宽空格 Database index content/markdown values no longer contain zero-width spaces https://github.com/siyuan-note/siyuan/issues/15204
fcontent = strings.ReplaceAll(fcontent, editor.Zwsp, "")
content = strings.ReplaceAll(content, editor.Zwsp, "")
markdown = strings.ReplaceAll(markdown, editor.Zwsp, "")
block = &Block{
ID: n.ID,
ParentID: parentID,