mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 06:24:06 +01:00
🎨 遗留的 Markdown 嵌套节点迁移为平铺的文本标记节点
This commit is contained in:
parent
6851656c09
commit
7ede0cbf52
3 changed files with 6 additions and 97 deletions
|
|
@ -150,7 +150,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
for _, tree := range trees {
|
||||
syPath := filepath.Join(unzipRootPath, tree.Path)
|
||||
if "" == tree.Root.Spec {
|
||||
treenode.NestedInlines2FlattedSpans(tree)
|
||||
luteEngine.NestedInlines2FlattedSpans(tree)
|
||||
tree.Root.Spec = "1"
|
||||
}
|
||||
renderer := render.NewJSONRenderer(tree, luteEngine.RenderOptions)
|
||||
|
|
@ -367,6 +367,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
}
|
||||
boxLocalPath = filepath.Join(util.DataDir, boxID)
|
||||
|
||||
luteEngine := NewLute()
|
||||
if gulu.File.IsDir(localPath) {
|
||||
// 收集所有资源文件
|
||||
assets := map[string]string{}
|
||||
|
|
@ -459,7 +460,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
targetPaths[curRelPath] = targetPath
|
||||
tree.HPath = hPath
|
||||
tree.Root.Spec = "1"
|
||||
treenode.NestedInlines2FlattedSpans(tree)
|
||||
luteEngine.NestedInlines2FlattedSpans(tree)
|
||||
|
||||
docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath))
|
||||
assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath)
|
||||
|
|
@ -547,7 +548,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
tree.Box = boxID
|
||||
tree.Path = targetPath
|
||||
tree.HPath = path.Join(baseHPath, title)
|
||||
treenode.NestedInlines2FlattedSpans(tree)
|
||||
luteEngine.NestedInlines2FlattedSpans(tree)
|
||||
|
||||
docDirLocalPath := filepath.Dir(filepath.Join(boxLocalPath, targetPath))
|
||||
assetDirPath := getAssetsDir(boxLocalPath, docDirLocalPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue