feat: single function to expand URLs

This commit is contained in:
thewh1teagle 2024-11-08 21:57:56 +02:00
parent cc1eb793d6
commit 40066f125a
No known key found for this signature in database
2 changed files with 6 additions and 9 deletions

View file

@ -56,7 +56,8 @@ func (result *result) parse() *Tweet {
if result.QuotedStatusResult.Result != nil {
tw.QuotedStatus = result.QuotedStatusResult.Result.parse()
}
tw.HTML = expandMediaURLs(tw.HTML, legacy.ExtendedEntities.Media)
tw.HTML = expandURLs(tw.HTML, legacy.Entities.URLs, legacy.ExtendedEntities.Media)
tw.HTML = expandURLs(tw.Text, legacy.Entities.URLs, legacy.ExtendedEntities.Media)
return tw
}