mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
⚡ 改进查询嵌入块加载性能 https://github.com/siyuan-note/siyuan/issues/6160
This commit is contained in:
parent
94139b8d86
commit
2faedbe7c6
3 changed files with 43 additions and 13 deletions
|
|
@ -1038,14 +1038,14 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool) (re
|
|||
var defMd string
|
||||
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
||||
stmt = html.UnescapeString(stmt)
|
||||
blocks := searchEmbedBlock(stmt, nil, 0)
|
||||
if 1 > len(blocks) {
|
||||
embedBlocks := searchEmbedBlock(stmt, nil, 0)
|
||||
if 1 > len(embedBlocks) {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
defMdBuf := bytes.Buffer{}
|
||||
for _, def := range blocks {
|
||||
defMdBuf.WriteString(renderBlockMarkdownR(def.ID))
|
||||
for _, def := range embedBlocks {
|
||||
defMdBuf.WriteString(renderBlockMarkdownR(def.Block.ID))
|
||||
defMdBuf.WriteString("\n\n")
|
||||
}
|
||||
defMd = defMdBuf.String()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue