Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve heading drag conversion doc subheading level https://github.com/siyuan-note/siyuan/issues/11037

Daniel0093dc38e8d3
diff --git a/kernel/model/heading.go b/kernel/model/heading.go
index c445f974ff..bfdf401f7a 100644
--- a/kernel/model/heading.go
+++ b/kernel/model/heading.go
@@ -342,7 +342,7 @@ func Heading2Doc(srcHeadingID, targetBoxID, targetPath string) (srcRootBlockID,
topLevel := treenode.TopHeadingLevel(newTree)
for c := newTree.Root.FirstChild; nil != c; c = c.Next {
if ast.NodeHeading == c.Type {
- c.HeadingLevel = c.HeadingLevel - topLevel + 1
+ c.HeadingLevel = c.HeadingLevel - topLevel + 2
if 6 < c.HeadingLevel {
c.HeadingLevel = 6
}