mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
⚡ 改进查询嵌入块加载性能 https://github.com/siyuan-note/siyuan/issues/6160
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user