mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-05 06:43:21 +00:00
link rewrite logic fix
This commit is contained in:
parent
a850af0526
commit
8668878548
|
@ -118,7 +118,7 @@ var funcMap = template.FuncMap{
|
|||
}
|
||||
converted := buf.String()
|
||||
converted = strings.Replace(converted, `<img `, `<img loading="lazy" `, -1)
|
||||
if os.Getenv("LEMMY_DOMAIN") != "" {
|
||||
if os.Getenv("LEMMY_DOMAIN") == "" {
|
||||
re := regexp.MustCompile(`href="https:\/\/([a-zA-Z0-9\.]+\/(c\/[a-zA-Z0-9]+|(post|comment)\/\d+))`)
|
||||
converted = re.ReplaceAllString(converted, `href="/$1`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue