mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-21 22:44:06 +01:00
🐛 导入 Markdown 文件夹后无法在其中继续导入 https://github.com/siyuan-note/siyuan/issues/7512
This commit is contained in:
parent
e772e97b72
commit
7074aacacc
2 changed files with 6 additions and 4 deletions
|
|
@ -509,8 +509,11 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
|
||||
curRelPath := filepath.ToSlash(strings.TrimPrefix(currentPath, localPath))
|
||||
targetPath := path.Join(baseTargetPath, id)
|
||||
hPath := path.Join(baseHPath, filepath.ToSlash(strings.TrimPrefix(currentPath, localPath)))
|
||||
hPath = strings.TrimSuffix(hPath, ext)
|
||||
if "" == curRelPath {
|
||||
curRelPath = "/"
|
||||
hPath = "/" + title
|
||||
} else {
|
||||
dirPath := targetPaths[path.Dir(curRelPath)]
|
||||
targetPath = path.Join(dirPath, id)
|
||||
|
|
@ -519,8 +522,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
targetPath = strings.ReplaceAll(targetPath, ".sy/", "/")
|
||||
targetPath += ".sy"
|
||||
targetPaths[curRelPath] = targetPath
|
||||
hPath := path.Join(baseHPath, filepath.ToSlash(strings.TrimPrefix(currentPath, localPath)))
|
||||
hPath = strings.TrimSuffix(hPath, ext)
|
||||
|
||||
if info.IsDir() {
|
||||
tree = treenode.NewTree(boxID, targetPath, hPath, title)
|
||||
if err = indexWriteJSONQueue(tree); nil != err {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue