Skip to content

Commit

Permalink
🎨 Improve importing Markdown #13245
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 24, 2024
1 parent 8ea1361 commit 7e04c33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/model/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ 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 := path.Join(baseHPath, filepath.Base(localPath), filepath.ToSlash(strings.TrimPrefix(currentPath, localPath)))
hPath = strings.TrimSuffix(hPath, ext)
if "" == curRelPath {
curRelPath = "/"
Expand Down Expand Up @@ -798,7 +798,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
if "" != yfmTitle {
title = yfmTitle
}
unescapedTitle, unescapeErr := url.QueryUnescape(title)
unescapedTitle, unescapeErr := url.PathUnescape(title)
if nil == unescapeErr {
title = unescapedTitle
}
Expand Down Expand Up @@ -920,7 +920,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
if "" != yfmTitle {
title = yfmTitle
}
unescapedTitle, unescapeErr := url.QueryUnescape(title)
unescapedTitle, unescapeErr := url.PathUnescape(title)
if nil == unescapeErr {
title = unescapedTitle
}
Expand Down

0 comments on commit 7e04c33

Please sign in to comment.