mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-08 13:01:08 -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
|
|
@ -52,9 +52,20 @@ func (p *Processor) SourceGet(ctx context.Context, requester *gtsmodel.Account,
|
|||
"target status not found",
|
||||
)
|
||||
}
|
||||
|
||||
// Try to use unparsed content
|
||||
// warning text if available,
|
||||
// fall back to parsed cw html.
|
||||
var spoilerText string
|
||||
if status.ContentWarningText != "" {
|
||||
spoilerText = status.ContentWarningText
|
||||
} else {
|
||||
spoilerText = status.ContentWarning
|
||||
}
|
||||
|
||||
return &apimodel.StatusSource{
|
||||
ID: status.ID,
|
||||
Text: status.Text,
|
||||
SpoilerText: status.ContentWarning,
|
||||
SpoilerText: spoilerText,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue