mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve export of empty documents with subdocuments https://github.com/siyuan-note/siyuan/issues/16040
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
156899cb44
commit
4c0d3365f1
2 changed files with 5 additions and 1 deletions
|
|
@ -2040,7 +2040,7 @@ func exportMarkdownContent(id, ext string, exportRefMode int, defBlockIDs []stri
|
|||
}
|
||||
|
||||
refCount := sql.QueryRootChildrenRefCount(tree.ID)
|
||||
if !Conf.Export.MarkdownYFM && 5 > len(tree.Root.KramdownIAL) && 1 > len(refCount) {
|
||||
if !Conf.Export.MarkdownYFM && treenode.ContainOnlyDefaultIAL(tree) && 1 > len(refCount) {
|
||||
for c := tree.Root.FirstChild; nil != c; c = c.Next {
|
||||
if ast.NodeParagraph == c.Type {
|
||||
isEmpty = nil == c.FirstChild
|
||||
|
|
|
|||
|
|
@ -125,3 +125,7 @@ func NewParagraph(id string) (ret *ast.Node) {
|
|||
func NewSpanAnchor(id string) (ret *ast.Node) {
|
||||
return &ast.Node{Type: ast.NodeInlineHTML, Tokens: []byte("<span id=\"" + id + "\" style=\"display: none;\"></span>")}
|
||||
}
|
||||
|
||||
func ContainOnlyDefaultIAL(tree *parse.Tree) bool {
|
||||
return 5 > len(tree.Root.KramdownIAL)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue