mirror of
https://github.com/jackyzha0/hugo-obsidian.git
synced 2024-06-14 11:42:35 +03:00
Fix wikilink processing bug
This commit is contained in:
parent
afb663e3ad
commit
a340a676f7
4
util.go
4
util.go
@ -23,9 +23,9 @@ func processTarget(source string) string {
|
|||||||
if strings.HasPrefix(source, "/") {
|
if strings.HasPrefix(source, "/") {
|
||||||
return strings.TrimSuffix(source, ".md")
|
return strings.TrimSuffix(source, ".md")
|
||||||
}
|
}
|
||||||
res := "/" + strings.TrimSuffix(strings.TrimSuffix(source, ".html"), ".md")
|
res := strings.Split(source, "#")[0]
|
||||||
|
res = "/" + strings.TrimSuffix(strings.TrimSuffix(res, ".html"), ".md")
|
||||||
res, _ = url.PathUnescape(res)
|
res, _ = url.PathUnescape(res)
|
||||||
res = strings.Split(res, "#")[0]
|
|
||||||
res = strings.TrimSpace(res)
|
res = strings.TrimSpace(res)
|
||||||
res = UnicodeSanitize(res)
|
res = UnicodeSanitize(res)
|
||||||
return strings.ReplaceAll(url.PathEscape(res), "%2F", "/")
|
return strings.ReplaceAll(url.PathEscape(res), "%2F", "/")
|
||||||
|
Loading…
Reference in New Issue
Block a user