RTL Text Pasted into Wordpress Visual Editor Renders LTR
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: brian, Assigned: emilio)
Details
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
- Edit a new post or page in the Wordpress visual editor (Gutenberg)
- Add a new paragraph block in the post or page
- Paste Hebrew text from https://blueletterbible.org into the paragraph block
Actual results:
Pasted Hebrew text displays backwards (LTR)
NOTE - When the post or page is previewed or published the Hebrew text renders correctly.
Also, the Hebrew rendering can be corrected by entering the HTML editing mode of the Gutenberg editor and putting explicit <rtl></rtl> tags around the Hebrew text. What is REALLY weird is that this corrects the RTL display of not only that particular block of Hebrew text, but also for every other block of Hebrew text on the page or post.
Expected results:
Hebrew text should have displayed correctly (RTL)
I tested with MS Edge, and the Gutenberg visual editor displays pasted RTL text correctly.
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Editor' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 3•4 years ago
•
|
||
I can reproduce this and I guess bidi is not enabled properly. I tried adding direction:rtl
at a random element outside of the editor and doing so suddenly fixed the issue.
Emilio, do you see what's happening here?
Comment 4•4 years ago
|
||
Copy this for your convenience: בְּרֵאשִׁית בָּרָא אֱלֹהִים אֵת הַשָּׁמַיִם וְאֵת הָאָֽרֶץ׃
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
That's exactly right. We stop properly updating CharacterData::mText.mState.mIsBidi once bidi is enabled in a document, but then if it gets adopted into a document which is not bidi-enabled we fail to enable bidi.
direction: rtl
"fixes" it because it force-enables bidi here.
Assignee | ||
Comment 6•4 years ago
|
||
Now without it being cropped, whoops
Assignee | ||
Comment 7•4 years ago
|
||
It's not a sound optimization in presence of adoption.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 9•4 years ago
|
||
bugherder |
Description
•