From 41b8271c5d9c1030ca4daefb2d8da06aa852edc6 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 8 Aug 2025 18:32:52 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15458 --- kernel/model/export.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index f58fb3380..b815b9515 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -2012,8 +2012,16 @@ func exportMarkdownContent(id, ext string, exportRefMode int, defBlockIDs []stri return } - if ast.NodeParagraph == tree.Root.FirstChild.Type { - isEmpty = nil == tree.Root.FirstChild.FirstChild + for c := tree.Root.FirstChild; nil != c; c = c.Next { + if ast.NodeParagraph == c.Type { + isEmpty = nil == c.FirstChild + if !isEmpty { + break + } + } else { + isEmpty = false + break + } } exportedMd = exportMarkdownContent0(id, tree, "", false, false, false,