Skip to content

Commit

Permalink
link rewrite logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rystaf authored Jul 4, 2023
1 parent a850af0 commit 8668878
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
}
Expand Down

0 comments on commit 8668878

Please sign in to comment.