mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-14 22:17:29 -06:00
rename some of the text functions for clarity
This commit is contained in:
parent
a05d4bac53
commit
c8556cfd97
16 changed files with 145 additions and 124 deletions
|
|
@ -1376,7 +1376,6 @@ func (c *Converter) baseStatusToFrontend(
|
|||
InReplyToID: nil, // Set below.
|
||||
InReplyToAccountID: nil, // Set below.
|
||||
Sensitive: *s.Sensitive,
|
||||
SpoilerText: text.HTMLToPlain(s.ContentWarning),
|
||||
Visibility: c.VisToAPIVis(ctx, s.Visibility),
|
||||
LocalOnly: s.IsLocalOnly(),
|
||||
Language: nil, // Set below.
|
||||
|
|
@ -1397,6 +1396,11 @@ func (c *Converter) baseStatusToFrontend(
|
|||
Text: s.Text,
|
||||
ContentType: ContentTypeToAPIContentType(s.ContentType),
|
||||
InteractionPolicy: *apiInteractionPolicy,
|
||||
|
||||
// Mastodon API says spoiler_text should be *text*, not HTML, so
|
||||
// parse any HTML back to plaintext when serializing via the API,
|
||||
// attempting to preserve semantic intent to keep it readable.
|
||||
SpoilerText: text.ParseHTMLToPlain(s.ContentWarning),
|
||||
}
|
||||
|
||||
if at := s.EditedAt; !at.IsZero() {
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ func filterableFields(s *gtsmodel.Status) []string {
|
|||
// remove markdown-formatting characters
|
||||
// and ensure more consistent filtering.
|
||||
if s.Content != "" {
|
||||
text := text.HTMLToPlain(s.Content)
|
||||
text := text.ParseHTMLToPlain(s.Content)
|
||||
if text != "" {
|
||||
fields = append(fields, text)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue