Open anantshri opened 6 months ago
If I open this post via a Mastodon account it displays correctly:
But it seems you're using some exotic AP server on your side? Maybe there is a conversion between the original content and the content provided by your server's MastoAPI that differs from a common Mastodon/Pleroma/etc MastoAPI output.
Sengi parses MastoAPI content to be able to render it properly, so if it's not exactly the same than an usual MastoAPI output, there will be parsing errors/weird bugs.
It looks like the link is getting dropped inside the processLink
function of DatabindedTextComponent
: https://github.com/NicolasConstant/sengi/blob/0f58252c61cd9cb4728268c738808bd09e8c0d8a/src/app/components/stream/status/databinded-text/databinded-text.component.ts#L157-L198
Links in GoToSocial are just the URL with an anchor around them and an appropriate href. Nothing fancy. They look like this:
<a href="https://example.org" rel="nofollow noreferrer noopener" target="_blank">https://example.org</a>
Sometimes they'll look more like this, if the user who posted the link has Markdown enabled and wrote a link in a slightly fancier way:
<a href="https://example.org" rel="nofollow noreferrer noopener" target="_blank">example link</a>
Or even like this, if the user added a title to the link:
<a href="https://example.org" title="this is a link title" rel="nofollow noreferrer noopener" target="_blank">example link</a>
Perhaps it would be possible to allow such links through instead of dropping them, since they're very standard, safe HTML.
So it's more about GoToSocial link support then?
If I remember correctly, link parsing was related to some Electron edge cases, that's not something I would change right now. It would be better to just document the new use cases via the unit tests and fix the code accordingly.
URL which is within the toot content is not rendered properly
Original post : https://tatooine.club/@nemo/111696202370333457
Rendered in sengi as:
This is rendered correctly at my server side https://social.anantshri.info/@anant/statuses/01HK9YEMJBS6KR4NP8VTK2RHMB
this is rendered correctly on other clients (icecubes / pinafore)
when i copy all data i get this