This commit is contained in:
Liang Ding 2022-10-12 10:11:08 +08:00
parent 94139b8d86
commit 2faedbe7c6
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 43 additions and 13 deletions

View file

@ -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()