snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy/
Creative Commons Zero v1.0 Universal
485 stars 28 forks source link

AT to AP - Strange link, or link applied to wrong text #1123

Closed hybridhavoc closed 2 weeks ago

hybridhavoc commented 3 weeks ago

Just ran across an odd issue I thought I would bring up here. A Bluesky post bridged over to ActivityPub has a link in a weird place.

The original Bluesky post has an @ mention for bsky.app which is displayed as a link on Bluesky. On the AP side there is no link on the @ mention, but there is a link on a different set of 9 characters.

User page on fed.brid.gy: https://fed.brid.gy/bsky/aielcakes.bsky.social

Unfortunately it doesn't look like there's a log available for that post.

enwin commented 3 weeks ago

I'm seeing the same issue with hashtags and @ mentions as well.

The first hashtag is properly mapped to a fediverse hashtag, but not the following ones. They also display a link displacement, same for the following @ mention.

User page on fed.brid.gy: https://fed.brid.gy/bsky/origasky.bsky.social

snarfed commented 3 weeks ago

Oof, yeah. Sorry! Will fix.

snarfed commented 3 weeks ago

Background: snarfed/granary@e08550ef5b2216739d840f284a34474857d110de interacted badly with #990 and https://github.com/snarfed/bridgy-fed/commit/b4124bd23fb21f8b2ca1cc11dfe15dfaefc6f779. I'm rolling back snarfed/granary@e08550ef5b2216739d840f284a34474857d110de, which should fix this regression, but that means AP => Bluesky profile bios still won't have meaningful whitespace, ie newlines won't show up. I'll need to figure that out.

snarfed commented 3 weeks ago

Sadly Mastodon's .status__content p { white-space: pre-wrap } style doesn't apply to profile bios, they have class account__header__content instead.

https://github.com/snarfed/bridgy-fed/blob/551637f6a1091c9317446001245b5fd94d9d2680/activitypub.py#L810-L816

Good motivation, really I want to bring back the \n => <br> translation anyway instead of depending on a project-specific CSS like that to preserve whitespace.

snarfed commented 3 weeks ago

OK, the regression here should be fixed. Example: https://bsky.app/profile/snarfed.bsky.social => https://indieweb.social/@snarfed.bsky.social@bsky.brid.gy/112587591636781521

I'll leave this open to figure out the rest.

snarfed commented 2 weeks ago

OK, fixed preserving whitespace in AP => Bluesky bios. Example: https://bsky.app/profile/evan.cosocial.ca.ap.brid.gy