more robust escaping for targets

This commit is contained in:
Jacky Zhao 2022-04-02 12:51:56 -07:00
parent 93d9ffe129
commit 605cd60c6f

View File

@ -24,6 +24,7 @@ func processTarget(source string) string {
return strings.TrimSuffix(source, ".md")
}
res := "/" + strings.TrimSuffix(strings.TrimSuffix(source, ".html"), ".md")
res, _ = url.PathUnescape(res)
res = strings.Split(res, "#")[0]
res = strings.TrimSpace(res)
return UnicodeSanitize(res)