mirror of
https://github.com/jackyzha0/hugo-obsidian.git
synced 2024-06-14 11:42:35 +03:00
more robust escaping for targets
This commit is contained in:
parent
93d9ffe129
commit
605cd60c6f
1
util.go
1
util.go
@ -24,6 +24,7 @@ func processTarget(source string) string {
|
|||||||
return strings.TrimSuffix(source, ".md")
|
return strings.TrimSuffix(source, ".md")
|
||||||
}
|
}
|
||||||
res := "/" + strings.TrimSuffix(strings.TrimSuffix(source, ".html"), ".md")
|
res := "/" + strings.TrimSuffix(strings.TrimSuffix(source, ".html"), ".md")
|
||||||
|
res, _ = url.PathUnescape(res)
|
||||||
res = strings.Split(res, "#")[0]
|
res = strings.Split(res, "#")[0]
|
||||||
res = strings.TrimSpace(res)
|
res = strings.TrimSpace(res)
|
||||||
return UnicodeSanitize(res)
|
return UnicodeSanitize(res)
|
||||||
|
Loading…
Reference in New Issue
Block a user