Commit Graph

31 Commits

Author SHA1 Message Date
TAKAHASHI Shuuji f88ad38294
Prepend invisible URL protocol prefix (#586) 2023-05-26 09:02:49 -06:00
TAKAHASHI Shuuji 2040124147
Prevent dropping ellipsis URL (#585) 2023-05-24 11:41:56 -06:00
Andrew Godwin 31c4f89124 Make mentions look EXACTLY like Mastodon 2023-05-13 10:40:00 -06:00
Andrew Godwin 67f64a4313 Fix mention formatting on Sengi 2023-05-13 10:32:36 -06:00
Christof Dorner 9775fa8991
Add `mention` class to user mention links (#575)
This should fix mention links in Elk to keep linking inside Elk, not to the instance of the mentioned user.
2023-05-09 09:55:19 -06:00
Andrew Godwin 1994671541 Correctly handle GTS mentions of same username
Fixes #546
2023-03-22 10:44:15 -06:00
Christof Dorner c94b54dde8
Add `mention` and `hashtag` classes to hashtag anchors (#542) 2023-03-15 13:49:23 -06:00
Andrew Godwin 42d6eb6000 Preserve ellipsis class on links when re-rendering 2023-02-19 23:01:50 -07:00
Humberto Rocha e625fae13d
Fix hashtag being handled as common link in the preview card (#515) 2023-02-19 20:35:54 -07:00
Andrew Godwin 4744f7d47c Don't try to render emojis for remote sends 2023-01-31 10:05:14 -07:00
Andrew Godwin a6922cb9d6 Move to a new HTML parser/stripper
This removes the use of the EOL'd Bleach, and also integrates hashtag,
mention and emoji searching into one single place.
2023-01-29 17:47:06 -07:00
Michael Manfre cc75863b8f
Fixes #431 - Preserve href when stripping <a> tags (#436) 2023-01-17 23:41:33 -07:00
Michael Manfre 333317875b
Don't show ellipsis when URL shortening only removed scheme (#427) 2023-01-16 12:27:25 -07:00
Michael Manfre 9b6ceee490
Apply Mastodon style link text shortening (#426) 2023-01-16 11:59:46 -07:00
Corry Haines cfe18932b8
Match sanitizing for posts to Mastodon (#422)
Creates filter for REWRITTEN_TAGS that converts them to `p` rather than ripping them out entirely, and formats `ul` as break-separated list

Both changes align sanitization to Mastodon's "strict" sanitizer at https://github.com/mastodon/mastodon/blob/main/lib/sanitize_ext/sanitize_config.rb#L73

I don't love the complexity of the Filter, but Bleach doesn't give us great options to work with. The code operates within an iterator without the useful "sibling" methods that Ruby's equivalent has. Also, Bleach runs filters _after_ sanitizing (unlike Ruby's which runs before) so we have to pass all the elements through the sanitizer, then rewrite them after the fact.
2023-01-15 22:32:04 -07:00
Corry Haines d8cee4097f
Modify emoji loader for cache-optimized return value (#371)
Also fixes an apparent bug in `imageify_emojis.replacer` where `include_local` was not being used correctly (previous code path never returned anything.
2023-01-07 15:19:47 -07:00
Michael Manfre c6c3914cc7
Include Identity metadata fields in ActivityPub messages (#295) 2022-12-27 17:42:30 -07:00
Andrew Godwin 44dc7a2ce4 Remove extra newlines in post content
Fixes #282
2022-12-27 11:53:44 -07:00
Michael Manfre 50c07f491e
Guard Post mentions processing from unfetched Identities (#272) 2022-12-25 14:37:31 -07:00
Michael Manfre ab398758a9
Fixed mention linking with mixed case usernames (#265) 2022-12-24 21:04:25 -07:00
Andrew Godwin 025fd5cf07 Emoji refactor
Emojis are now prefetched from the post, and if not, looked up
individually by shortcode, to prevent loading hundreds.
2022-12-22 16:55:31 +00:00
Andrew Godwin ca3dc82a62 Don't linkify hashtags in usernames and metadata
Fixes #228
2022-12-22 01:10:56 +00:00
Andrew Godwin 51d34eda9c Significantly better hashtag link parsing
Fixes #203
2022-12-20 13:55:14 +00:00
Andrew Godwin 78d2283458 Move linkifying to all http-prefixed links 2022-12-20 13:21:50 +00:00
Andrew Godwin 4ad4f468a4 Refactor HTML rendering into one place
Also suppress using external <a> tags for now, until we can separate
them from hashtags properly.
2022-12-20 11:39:45 +00:00
Tyler Kennedy cfa97b9740
Mitra Fixes (#207)
Don't send a list when populating Accept header. This seems to work fine on Mastodon and friends, and fixes a bug with the Mitra server until resolved upstream.
2022-12-19 11:21:04 +00:00
Andrew Godwin 8e9e3ecf69 Some cleanup around editing 2022-11-27 12:09:08 -07:00
Andrew Godwin 53d9452917 Outgoing mentions mostly work (exc. cc followers) 2022-11-21 21:18:13 -07:00
Andrew Godwin 2a3690d1c1 Return images and summary in actor 2022-11-17 17:55:50 -07:00
Andrew Godwin b5cacb09e3 Permit Mastodon's weird HTML through 2022-11-13 19:03:43 -07:00
Andrew Godwin feb5d9b74f Got up to incoming posts working 2022-11-11 22:02:43 -07:00