mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Trim space in dialynote/block ref/new doc save path https://github.com/siyuan-note/siyuan/issues/14482
This commit is contained in:
parent
54c25af19f
commit
4c080e2b34
3 changed files with 15 additions and 6 deletions
|
|
@ -38,6 +38,15 @@ var (
|
|||
UserAgent = "SiYuan/" + Ver
|
||||
)
|
||||
|
||||
func TrimSpaceInPath(p string) string {
|
||||
p = strings.ReplaceAll(p, "\\", "/")
|
||||
parts := strings.Split(p, "/")
|
||||
for i, part := range parts {
|
||||
parts[i] = strings.TrimSpace(part)
|
||||
}
|
||||
return strings.Join(parts, "/")
|
||||
}
|
||||
|
||||
func GetTreeID(treePath string) string {
|
||||
if strings.Contains(treePath, "\\") {
|
||||
return strings.TrimSuffix(filepath.Base(treePath), ".sy")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue