Support Bidirectional Content Editing for RTL Languages - #429
Open
rabdulwahhab wants to merge 3 commits into
Open
Support Bidirectional Content Editing for RTL Languages#429rabdulwahhab wants to merge 3 commits into
rabdulwahhab wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The rich-text editor assumes left-to-right presentation, which makes right-to-left languages (e.g. Arabic, Farsi, Urdu, etc.) difficult to write and review. Mixed-direction content can render with incorrect alignment, misplaced list markers and quote borders, and hard-to-read inline code. This is a meaningful usability and accessibility gap for RTL-language users and limits who can comfortably use PagesCMS. Supporting bidirectional editing makes the product meaningfully more inclusive without changing how content is stored!
Solution
Resolve text direction automatically within the editor while keeping stored Markdown unchanged.
Testing
Tested locally with side-by-side before and after versions of the editor using mixed Arabic and English Markdown (screenshots below). Verified headings, paragraphs, inline code, blockquotes, lists, tables, and fenced code blocks; each block resolved to the correct direction, code remained left-to-right, and Markdown round-tripped without injected direction attributes or HTML. The lint, TypeScript, and production build checks also pass.
Notes
startandendproperties, such asmargin-inline,padding-inline, andborder-inline, instead of physicalleftandrightproperties. This preserves correct layout behavior for both LTR and RTL content.Screenshots
Before
After
I really like PagesCMS and think that RTL editing support could help PagesCMS reach more users and stand out amongst other CMS editors that don't have RTL support.
Thanks!