Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always use utf8 offsets #3024

Merged
merged 1 commit into from
Feb 28, 2024
Merged

always use utf8 offsets #3024

merged 1 commit into from
Feb 28, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Feb 28, 2024

Because of varying emoji lengths, relying on Swift's String.Index instead of utf-16 offsets is a safer option when determining a text range. Right now, some emojis may cause links to not be pressable, since we are scanning the incorrect offset.

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested using the problem posts we've found in the last couple days, all works great 👍

@haileyok haileyok merged commit c7de733 into main Feb 28, 2024
5 checks passed
@haileyok haileyok deleted the hailey/text-emoji-link branch February 28, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants