Hotfix: Reblog content were not visible

This commit is contained in:
Romain de Laage 2022-05-11 15:28:11 +02:00
parent 88707930b9
commit 87784a8166
Signed by: rdelaage
GPG Key ID: 534845FADDF0C329
2 changed files with 7 additions and 7 deletions

View File

@ -22,11 +22,6 @@ import (
"time"
)
type OriginalBlog struct {
Id string `json:"id"`
Author Account `json:"account"`
}
type Blog struct {
Id string `json:"id"`
Content string `json:"content"`
@ -34,7 +29,7 @@ type Blog struct {
Author Account `json:"account"`
Tags []Tag `json:"tags"`
Mentions []Mention `json:"mentions"`
Reblog *OriginalBlog `json:"reblog"`
Reblog *Blog `json:"reblog"`
Medias []Media `json:"media_attachments"`
}

View File

@ -89,7 +89,12 @@ func removeHTMLTags(content string) string {
}
func formatBlog(toot Blog) string {
content := toot.Content
var content string
if toot.Reblog == nil {
content = toot.Content
} else {
content = toot.Reblog.Content
}
content = removeHTMLTags(content)
content = strings.Trim(content, " \n\r")
content = strings.ReplaceAll(content, "\n#", "\n[#]")