diff --git a/kernel/model/import.go b/kernel/model/import.go index 4d69a3a1a..1745c6d0d 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -67,7 +67,7 @@ func HTML2Markdown(htmlStr string, luteEngine *lute.Lute) (markdown string, with } func HTML2Tree(htmlStr string, luteEngine *lute.Lute) (tree *parse.Tree, withMath bool) { - htmlStr = util.RemoveInvalid(htmlStr) + htmlStr = gulu.Str.RemovePUA(htmlStr) assetDirPath := filepath.Join(util.DataDir, "assets") tree = luteEngine.HTML2Tree(htmlStr) ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus { diff --git a/kernel/model/search.go b/kernel/model/search.go index a18864e10..521800df7 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -1412,7 +1412,6 @@ func fullTextSearchCountByRegexp(exp, boxFilter, pathFilter, typeFilter, ignoreF } func fullTextSearchByFTS(query, boxFilter, pathFilter, typeFilter, ignoreFilter, orderBy string, beforeLen, page, pageSize int) (ret []*Block, matchedBlockCount, matchedRootCount int) { - query = stringQuery(query) table := "blocks_fts" // 大小写敏感 if !Conf.Search.CaseSensitive { table = "blocks_fts_case_insensitive" diff --git a/kernel/util/path.go b/kernel/util/path.go index 0669d05d1..a9617da84 100644 --- a/kernel/util/path.go +++ b/kernel/util/path.go @@ -38,6 +38,9 @@ var ( ) func GetTreeID(treePath string) string { + if strings.Contains(treePath, "\\") { + return strings.TrimSuffix(filepath.Base(treePath), ".sy") + } return strings.TrimSuffix(path.Base(treePath), ".sy") }