Slate detects text direction on a block level e.g. paragraph which is fine in most cases but its implementation is naive. For example, if you have an English word at the beginning of a paragraph written mostly in Arabic the whole paragraph would be marked as ltr instead of rtl.
At Contentful, we don't need to guess the direction, we already have the locale information exposed in the Field SDK which is respected in other field editors e.g. SingleLineEditor. This PR brings some of that to RT but it's no where near complete. To fully support RTL we have to adjust the styling of some the elements e.g. blockquotes, tables ..etc.
This fixes the problem at hand and serves as a first step in the right direction.
Slate detects text direction on a block level e.g. paragraph which is fine in most cases but its implementation is naive. For example, if you have an English word at the beginning of a paragraph written mostly in Arabic the whole paragraph would be marked as
ltr
instead ofrtl
.At Contentful, we don't need to guess the direction, we already have the locale information exposed in the Field SDK which is respected in other field editors e.g. SingleLineEditor. This PR brings some of that to RT but it's no where near complete. To fully support RTL we have to adjust the styling of some the elements e.g. blockquotes, tables ..etc.
This fixes the problem at hand and serves as a first step in the right direction.