diff options
Diffstat (limited to 'internal/web/opengraph.go')
-rw-r--r-- | internal/web/opengraph.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/web/opengraph.go b/internal/web/opengraph.go index 9636e408f..6fcc524cd 100644 --- a/internal/web/opengraph.go +++ b/internal/web/opengraph.go @@ -134,11 +134,11 @@ func parseTitle(account *apimodel.Account, accountDomain string) string { // parseDescription returns a string description which is // safe to use as a template.HTMLAttr inside templates. func parseDescription(in string) string { - i := html.UnescapeString(in) - i = text.SanitizePlaintext(i) - i = strings.ReplaceAll(i, "\"", "'") - i = strings.ReplaceAll(i, `\`, "") + i := text.SanitizePlaintext(in) i = strings.ReplaceAll(i, "\n", " ") + i = strings.Join(strings.Fields(i), " ") + i = html.EscapeString(i) + i = strings.ReplaceAll(i, `\`, "\") i = trim(i, maxOGDescriptionLength) return `content="` + i + `"` } |