mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🐛 父文档名带有结尾空格导致子文档无法导出 Fix https://github.com/siyuan-note/siyuan/issues/5742
This commit is contained in:
parent
87f681cce2
commit
1d79dc2300
1 changed files with 7 additions and 3 deletions
|
|
@ -142,9 +142,12 @@ func FilterUploadFileName(name string) string {
|
|||
}
|
||||
|
||||
func FilterFilePath(p string) (ret string) {
|
||||
ret = strings.ReplaceAll(p, "/", "__@sep__")
|
||||
ret = FilterFileName(ret)
|
||||
ret = strings.ReplaceAll(ret, "__@sep__", "/")
|
||||
parts := strings.Split(p, "/")
|
||||
var filteredParts []string
|
||||
for _, part := range parts {
|
||||
filteredParts = append(filteredParts, FilterFileName(part))
|
||||
}
|
||||
ret = strings.Join(filteredParts, "/")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -159,6 +162,7 @@ func FilterFileName(name string) string {
|
|||
name = strings.ReplaceAll(name, "<", "")
|
||||
name = strings.ReplaceAll(name, ">", "")
|
||||
name = strings.ReplaceAll(name, "|", "")
|
||||
name = strings.TrimSpace(name)
|
||||
return name
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue