superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.65k stars 308 forks source link

[feature] Remove the `quote-inline` class from statuses #2867

Open GeopJr opened 4 months ago

GeopJr commented 4 months ago

Is your feature request related to a problem ?

When *oma, *key(?) and treehouse.systems mastodon do a quote post, they wrap RE: <link> in a span with the class quote-inline, so clients hide that line if they support quote posts. GTS seems to be keeping them while removing the quote, ending up in quotes without a link to the original

Describe the solution you'd like.

quote-inline gets removed until quotes get implemented (if at all)

Describe alternatives you've considered.

From my client's side, I'll check if there's a quote property available before removing the RE: ... sentence

Additional context.

https://github.com/GeopJr/Tuba/issues/926

tsmethurst commented 4 months ago

Could you give an example? It's not totally clear from the issue what's being removed, what's not being removed, and what should be kept.

daenney commented 4 months ago

I think there's an example in https://github.com/GeopJr/Tuba/issues/926#issuecomment-2078222655, if you expand the "Details" thingy.

tsmethurst commented 4 months ago

Oh OK, we could probably just add that to our sanitizer then.

GeopJr commented 4 months ago

Yep, I'll include it here too:

GTS:

<span class="h-card"><a class="u-url mention" href="https://queer.party/@yavien" rel="ugc nofollow noreferrer noopener" target="_blank">@<span>yavien</span></a></span> seconded from my own personal experience<span class="quote-inline"><br><br>RE: <a href="https://queer.party/users/yavien/statuses/112333867184539778" rel="nofollow noreferrer noopener" target="_blank">https://queer.party/users/yavien/statuses/112333867184539778</a></span>

Mastodon:

<span class="h-card"><a class="u-url mention" href="https://queer.party/@yavien" rel="nofollow noopener noreferrer" target="_blank">@<span>yavien</span></a></span> seconded from my own personal experience<span class=""><br><br>RE: <a href="https://queer.party/users/yavien/statuses/112333867184539778" rel="nofollow noopener noreferrer" target="_blank">https://queer.party/users/yavien/statuses/112333867184539778</a></span>

diff:

- experience<span class=""><br><br>RE: <a href=
+ experience<span class="quote-inline"><br><br>RE: <a href=

edit:

I want quote-inline to be sanitized until (or if) GoToSocial adds quote support. That class is used by AP servers that support quotes to indicate what elements are included for compatibility with clients that do not support displaying the quoted posts.

So in the case of Tuba, since we do display quoted posts when provided, we remove any elements that have the quote-inline class. From our side, we will now also check if a quoted post is provided at all before removing those elements but other clients might not do that so it's better if GTS just sanitizes that, like Mastodon does!

tsmethurst commented 4 months ago

Got it, thanks for the extra detail :+1: