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

This commit is contained in:
Daniel 2024-04-15 09:21:15 +08:00
parent 8963c4d817
commit 0093dc38e8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}