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

fix: Render hashtags, mentions, and initial paras correctly in RTL #906

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

nikclayton
Copy link
Contributor

Previous code didn't set the textDirection for the status content, so the first para of RTL text might be rendered incorrectly.

In addition, mentions and tags weren't BIDI wrapped, so would appear as "foo@" and "foo#" in RTL statuses, instead of "@foo" and "#foo".

Fix both of these issues.

Fixes #870

Previous code didn't set the textDirection for the status content,
so the first para of RTL text might be rendered incorrectly.

In addition, mentions and tags weren't BIDI wrapped, so would appear
as "foo@" and "foo#" in RTL statuses, instead of "@foo" and "#foo".

Fix both of these issues.

Fixes #870
@nikclayton nikclayton merged commit 766dc1f into main Aug 28, 2024
23 checks passed
@nikclayton nikclayton deleted the 870-bidi-fix branch August 28, 2024 15:46
@NeatNit
Copy link

NeatNit commented Aug 29, 2024

Thanks for the fix, I'll test it out when the next update hits F-Droid :)

I suspect it'll be over-eager to switch to RTL. According to https://developer.android.com/reference/android/view/View.html#attr_android:textDirection (emphasis mine):

anyRtl 2 The paragraph direction is RTL if it contains any strong RTL character

It looks to me like firstStrong (the default) is the desired behavior, it just needs to ignore the isolated substring. Is unicodeWrap not sufficient on its own?

If my reading is right, anyRtl will make a post like this unreadable:

I like the letter י because it's so small

@nikclayton
Copy link
Contributor Author

Good point, and thanks for the example. Fixed with #910

@NeatNit
Copy link

NeatNit commented Sep 7, 2024

Just got the update, all seems good :)

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.

@usernames should not determine bidi direction
2 participants