mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-08 05:19:32 -06:00
[feature] Parse content warning as HTML, serialize via API to plaintext
This commit is contained in:
parent
69461c461b
commit
22ce924129
47 changed files with 947 additions and 553 deletions
|
|
@ -67,7 +67,7 @@ func OGBase(instance *apimodel.InstanceV1) *OGMeta {
|
|||
}
|
||||
|
||||
og := &OGMeta{
|
||||
Title: text.SanitizeToPlaintext(instance.Title) + " - GoToSocial",
|
||||
Title: text.RemoveHTML(instance.Title) + " - GoToSocial",
|
||||
Type: "website",
|
||||
Locale: locale,
|
||||
URL: instance.URI,
|
||||
|
|
@ -161,7 +161,7 @@ func AccountTitle(account *apimodel.WebAccount, 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 := text.SanitizeToPlaintext(in)
|
||||
i := text.RemoveHTML(in)
|
||||
i = strings.ReplaceAll(i, "\n", " ")
|
||||
i = strings.Join(strings.Fields(i), " ")
|
||||
i = html.EscapeString(i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue