IceCubesApp/Packages
Grant McSheffrey 30f9da06c8
Support status links with non-ASCII characters (Bugfix 1546) (#1550)
* Allow creation of URL objects from strings containing non-ASCII characters

Adds a new initializer for creating URL objects with a flag to specify that
non-ASCII characters found in the path or query string should first be
URL encoded.

* Add basic test for creating HTMLString objects

* Encode link paths and queries when parsing statuses

It's common to use non-ASCII characters in URLs even though they're technically
invalid characters. Every modern browser handles this by silently encoding
the invalid characters on the user's behalf. However, trying to create a URL
object with un-encoded characters will result in nil so we need to encode the
invalid characters before creating the URL object. The unencoded version
should still be shown in the displayed status.

The parsing of the URL string is a little messy because we can't use the URL
class for this scenario and need to duplicate some of its work.

* Only encode link URLs as a backup

If a URL can be created from a status href, don't try URL encoding
it as this could result in double encoding. Only encode the string
if the creation of a URL fails. This is also more efficient.
2023-08-23 07:08:12 +02:00
..
Account Keep the new keyword field focused 2023-07-22 19:21:29 +02:00
AppAccount Run swiftformat 2023-07-19 07:46:25 +02:00
Conversations Run swiftformat 2023-07-19 07:46:25 +02:00
DesignSystem Run swiftformat 2023-07-19 07:46:25 +02:00
Env Edit tag groups 2023-08-04 12:40:21 +02:00
Explore Run swiftformat 2023-07-19 07:46:25 +02:00
Lists Fix CustomEmoji Baseline Offset (#1188) 2023-03-06 15:21:26 +01:00
Models Support status links with non-ASCII characters (Bugfix 1546) (#1550) 2023-08-23 07:08:12 +02:00
Network Run swiftformat 2023-07-19 07:46:25 +02:00
Notifications Timeline & Timeline detail accessibility uplift (#1323) 2023-03-28 18:48:58 +02:00
Status Poll close in … : Fixing missing space in some locales (#1536) 2023-08-10 08:59:08 +02:00
Timeline Edit tag groups 2023-08-04 12:40:21 +02:00