mavonEditor icon indicating copy to clipboard operation
mavonEditor copied to clipboard

[Feature] Add bidi support

Open ahangarha opened this issue 2 years ago • 1 comments

🚀 Feature Proposal

Add bidi (bidirectional text) support so without being explicit about direction, text gets rendered in correct direction (RTL or LTR).

Motivation

Not everybody write in Latin script and not all documents are written only in one direction (either RTL or LTR). We need to empower our editors and render engines to handle RTL and LTR without being explicit about the direction of text. Here comes bidi (bidirectional text) support

Example

In most of cases, adding dir="auto" adds such feature to the element containing user generated text. Yet, there shouldn't be absolute references for alignment or border, padding and margin. There are other ways to apply these styles accordingly.

This way, direction of text gets determined by the first strong character.

This is what gitlab uses for a long time and github also added very recently. You may see the following examples:


راست left
یک two سه four

left راست
one دو three چهار


راست left  
یک two سه four

left راست  
one دو three چهار

I am available for any help.

ahangarha avatar Dec 26 '21 11:12 ahangarha

Great, I don't know much about this, welcome PR.

ygj6 avatar Dec 27 '21 09:12 ygj6