This commit is contained in:
Daniel 2025-08-01 10:56:08 +08:00
parent 211648b95e
commit 16d3b65b2a
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 10 additions and 1 deletions

View file

@ -2213,9 +2213,12 @@ func getRefSearchIgnoreLines() (ret []string) {
func filterQueryInvisibleChars(query string) string {
query = strings.ReplaceAll(query, " ", "_@full_width_space@_")
query = strings.ReplaceAll(query, "\t", "_@tab@_")
query = strings.ReplaceAll(query, string(gulu.ZWJ), "__@ZWJ@__")
query = util.RemoveInvalid(query)
query = strings.ReplaceAll(query, "_@full_width_space@_", " ")
query = strings.ReplaceAll(query, "_@tab@_", "\t")
query = strings.ReplaceAll(query, "__@ZWJ@__", string(gulu.ZWJ))
query = strings.ReplaceAll(query, string(gulu.ZWJ)+"#", "#")
return query
}

View file

@ -667,8 +667,9 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
return
case ast.NodeTextMark:
typ := treenode.TypeAbbr(n.Type.String()) + " " + n.TextMarkType
text := n.Content()
text := strings.TrimSuffix(n.Content(), string(gulu.ZWJ))
markdown := treenode.ExportNodeStdMd(n, luteEngine)
markdown = strings.ReplaceAll(markdown, string(gulu.ZWJ)+"#", "#")
parentBlock := treenode.ParentBlock(n)
span := &Span{
ID: ast.NewNodeID(),
@ -873,6 +874,11 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
content = strings.ReplaceAll(content, editor.Zwsp, "")
markdown = strings.ReplaceAll(markdown, editor.Zwsp, "")
// 剔除标签结尾处的零宽连字符 Improve search for emojis in tags https://github.com/siyuan-note/siyuan/issues/15391
fcontent = strings.ReplaceAll(fcontent, string(gulu.ZWJ)+"#", "#")
content = strings.ReplaceAll(content, string(gulu.ZWJ)+"#", "#")
markdown = strings.ReplaceAll(markdown, string(gulu.ZWJ)+"#", "#")
block = &Block{
ID: n.ID,
ParentID: parentID,