-
Notifications
You must be signed in to change notification settings - Fork 60.9k
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
[Bug] RTL character causes text direction issue #2614
Comments
这不是算是bug吧,应该是正常的行为。 所以有阿语一般都会自动从右往左书写。在css中通过 direction可以控制。
所以这是正常行为。如果非要从左往右,修改 |
This is not a bug, it should be normal behavior. Therefore, Arabic is generally written automatically from right to left. It can be controlled by direction in css.
So this is normal behavior. If you must go from left to right, modify the code in |
Hey leadscloud, Thanks for your response! I really appreciate you explaining the right-to-left behavior in relation to the Arabic language. Since I'm an Arabic speaker, I wanted to suggest a couple of solutions to fix the garbled text issue: One acceptable solution could be to force a left-to-right (LTR) layout for all paragraphs, regardless of whether there are RTL characters or not. A better solution, which I've seen implemented in Google Keep, is to check the first letter of each paragraph. If it's an LTR character, the paragraph should be displayed in LTR, and if it's an RTL character, the paragraph should be displayed in RTL. This way, each paragraph follows its natural direction and provides a better user experience. I know I'm not a developer, but I think these suggestions could really improve the readability. Thanks for considering these ideas! |
Sorry, big mistake for non-Latin or Arabic scripts.
Also, it would be awesome if it used a loop to check for the next character if the first one or its neighbor are not letters. |
这看起来是个简单的问题,处理起来可能是比较复杂的,需要考虑的情况很多,比如希伯来语(he),阿拉伯语(ar) 阿拉伯语、希伯来语、波斯语、乌尔都语、克什米尔语、普什图语、维吾尔语、索拉尼库尔德语、旁遮普语和信德语是现代最广泛使用的 RTL 书写系统 如果全部处理需要一个单独的库比如react-intl 来判断语言,对于混合内容 又需要特别处理,也许可以在界面上方有一个提示按钮,让用户选择LTR还是RTL。 当然,最简单的判断就是当前的写法, content contains arabric
content start with arabric
这是一个比较小众的需求,有需求的可以直接修改以上代码。 今天学到一个新知识: |
Just use |
Describe the bug
When an RTL (Right-to-Left) character is introduced in the text, the entire text becomes RTL, even in paragraphs that do not have an RTL character. This issue occurs when the text is not in editing mode.
Expected behavior
Each paragraph should follow the direction of its first character. If the first character is LTR (Left-to-Right), the whole paragraph should be LTR. If the first character is RTL, the whole paragraph should be RTL.
Screenshots


This is how the first question should look:
Deployment
Desktop (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: