snarfed / bridgy-fed

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

Text in angle brackets (`<text>`) hidden in bridged posts (Bsky→Masto) #1380

Open jmcken1 opened 1 month ago

jmcken1 commented 1 month ago

(Apologies for the empty initial post; hit Enter before I’d even finished typing the title, grr.)

I just noticed that any text I post on Bluesky wrapped in angle brackets, like <this>, is hidden in the bridged posts on Mastodon.

For instance, here’s a recent Bluesky post, and here’s the bridged post on Mastodon.

I suppose a workaround for now is to use square brackets, but still, it would be nice of angle-bracketed text didn’t disappear.

snarfed commented 1 month ago

Ooh, thanks for filing! AS2 (ie Mastodon) content is HTML, and I'm probably not HTML-escaping text from Bluesky.

jmcken1 commented 1 month ago

Ah, figured that was it. Hope that’s something that can be fixed. 🙂

qazmlp commented 1 month ago

Ooh, thanks for filing! AS2 (ie Mastodon) content is HTML, and I'm probably not HTML-escaping text from Bluesky.

Confirmed:

Bluesky post containing HTML tags when viewed in Mastodon, the HTML tags are either evaluated or stripped entirely

Mastodon supports quite a bit more formatting than I thought. Only <mark>, <cite>, <dfn> and <ins> are stripped here.

snarfed commented 1 month ago

lol, lmao snarfed/granary@f9cb19270e05b88a570d18ea7287d998c2f56377:

bluesky.to_as1: escape HTML characters in `app.bsky.actor.profile` `description`

for https://github.com/snarfed/bridgy-fed/issues/1144

also includes a `@skip`ed test for doing the same thing in `app.bsky.feed.post` `text`, which is more difficult to implement because we'll have to shuffle facet/tag indices over to match every time we escape an HTML char.

...why they went with span-based rich text instead of markup-based, like the standards community has mostly settled on, I still don't know. They're even doubling down in https://github.com/bluesky-social/atproto/discussions/2830, which will at least make their way easier to work with.