mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
🎨 Add Settings - Search - Index - Asset path Fix https://github.com/siyuan-note/siyuan/issues/8221
This commit is contained in:
parent
49c5e3be9d
commit
3790507ee2
16 changed files with 64 additions and 26 deletions
|
|
@ -267,7 +267,10 @@ func initDBConnection() {
|
|||
db.SetConnMaxLifetime(365 * 24 * time.Hour)
|
||||
}
|
||||
|
||||
var caseSensitive bool
|
||||
var (
|
||||
caseSensitive bool
|
||||
indexAssetPath bool
|
||||
)
|
||||
|
||||
func SetCaseSensitive(b bool) {
|
||||
caseSensitive = b
|
||||
|
|
@ -278,6 +281,10 @@ func SetCaseSensitive(b bool) {
|
|||
}
|
||||
}
|
||||
|
||||
func SetIndexAssetPath(b bool) {
|
||||
indexAssetPath = b
|
||||
}
|
||||
|
||||
func refsFromTree(tree *parse.Tree) (refs []*Ref, fileAnnotationRefs []*FileAnnotationRef) {
|
||||
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if entering {
|
||||
|
|
@ -701,9 +708,9 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
|
|||
length = utf8.RuneCountInString(fcontent)
|
||||
} else if n.IsContainerBlock() {
|
||||
markdown = treenode.ExportNodeStdMd(n, luteEngine)
|
||||
content = treenode.NodeStaticContent(n, nil, true)
|
||||
content = treenode.NodeStaticContent(n, nil, true, indexAssetPath)
|
||||
fc := treenode.FirstLeafBlock(n)
|
||||
fcontent = treenode.NodeStaticContent(fc, nil, false)
|
||||
fcontent = treenode.NodeStaticContent(fc, nil, false, false)
|
||||
parentID = n.Parent.ID
|
||||
// 将标题块作为父节点
|
||||
if h := heading(n); nil != h {
|
||||
|
|
@ -712,7 +719,7 @@ func buildBlockFromNode(n *ast.Node, tree *parse.Tree) (block *Block, attributes
|
|||
length = utf8.RuneCountInString(fcontent)
|
||||
} else {
|
||||
markdown = treenode.ExportNodeStdMd(n, luteEngine)
|
||||
content = treenode.NodeStaticContent(n, nil, true)
|
||||
content = treenode.NodeStaticContent(n, nil, true, indexAssetPath)
|
||||
parentID = n.Parent.ID
|
||||
// 将标题块作为父节点
|
||||
if h := heading(n); nil != h {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue