mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-05 06:43:21 +00:00
fix relative links for multi-instance mode
This commit is contained in:
parent
7d6212b663
commit
c874a3291b
|
@ -153,6 +153,9 @@ var funcMap = template.FuncMap{
|
||||||
}
|
}
|
||||||
body = buf.String()
|
body = buf.String()
|
||||||
body = strings.Replace(body, `<img `, `<img loading="lazy" `, -1)
|
body = strings.Replace(body, `<img `, `<img loading="lazy" `, -1)
|
||||||
|
if host != "." {
|
||||||
|
body = RegReplace(body, `href="/`, `href="./`)
|
||||||
|
}
|
||||||
body = RegReplace(body, `href="(https:\/\/[a-zA-Z0-9\.\-]+\/(c|u|comment|post)\/[^#\?]*?)"`, `href="/`+host+`/link?url=$1"`)
|
body = RegReplace(body, `href="(https:\/\/[a-zA-Z0-9\.\-]+\/(c|u|comment|post)\/[^#\?]*?)"`, `href="/`+host+`/link?url=$1"`)
|
||||||
body = RegReplace(body, `::: ?spoiler (.*?)\n([\S\s]*?):::`, "<details><summary>$1</summary>$2</details>")
|
body = RegReplace(body, `::: ?spoiler (.*?)\n([\S\s]*?):::`, "<details><summary>$1</summary>$2</details>")
|
||||||
return template.HTML(body)
|
return template.HTML(body)
|
||||||
|
|
Loading…
Reference in a new issue