🐛 Fix relative path when importing markdown folder (#14096)

Close #14095
This commit is contained in:
Levi Zim 2025-02-15 23:40:15 +08:00 committed by GitHub
parent 6080f86693
commit 530345bd09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -866,13 +866,13 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
return ast.WalkContinue
}
absolutePath := filepath.Join(localPath, dest)
absolutePath := filepath.Join(currentDir, dest)
newAbsolutePath := absolutePath
decodedDest := string(html.DecodeDestination([]byte(dest)))
if decodedDest != dest {
dest = decodedDest
newAbsolutePath = filepath.Join(localPath, dest)
newAbsolutePath = filepath.Join(currentDir, dest)
gulu.File.Copy(absolutePath, newAbsolutePath)
}