🎨 The old version of the application no longer supports opening the new version of the document https://github.com/siyuan-note/siyuan/issues/16505

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-03 22:03:13 +08:00
parent 9e075581ff
commit b5c84f2354
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
21 changed files with 114 additions and 41 deletions

View file

@ -23,6 +23,7 @@ import (
"github.com/88250/lute/editor"
"github.com/88250/lute/render"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util"
)
@ -63,13 +64,13 @@ func AutoSpace(rootID string) (err error) {
formatRenderer := render.NewFormatRenderer(tree, luteEngine.RenderOptions)
md := formatRenderer.Render()
newTree := parseKTree(md)
newTree.Root.Spec = "1"
newTree.Root.Spec = treenode.CurrentSpec
// 第二次格式化启用自动空格
luteEngine.SetAutoSpace(true)
formatRenderer = render.NewFormatRenderer(newTree, luteEngine.RenderOptions)
md = formatRenderer.Render()
newTree = parseKTree(md)
newTree.Root.Spec = "1"
newTree.Root.Spec = treenode.CurrentSpec
newTree.Root.ID = tree.ID
newTree.Root.KramdownIAL = rootIAL
newTree.ID = tree.ID