remove extra newlines on some PIxelfed posts (#4672)

closes https://github.com/tuskyapp/Tusky/issues/4663
This commit is contained in:
Konrad Pozniak 2024-09-13 15:52:48 +02:00 committed by GitHub
parent 767f10a5db
commit b693d4d466
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -34,6 +34,7 @@ fun String.parseAsMastodonHtml(tagHandler: TagHandler? = tuskyTagHandler): Spann
return this.replace("<br> ", "<br>&nbsp;")
.replace("<br /> ", "<br />&nbsp;")
.replace("<br/> ", "<br/>&nbsp;")
.replace("<br>\n", "<br/>") // pixelfed quirk https://github.com/tuskyapp/Tusky/issues/4663
.replace("\n", "<br/>")
.replace(" ", "&nbsp;&nbsp;")
.parseAsHtml(tagHandler = tagHandler)