Corinnebelle wrote: Sun Mar 06, 2022 10:42 pm
I am having trouble getting things into bold in Hebrew. שלום, מה קורה
Wrapping a word looks wrong in the editor:
Code: Select all
**שלום**, מה קורה
[b]שלום[/b], מה קורה
but renders correctly in the post:
שלום, מה קורה
שלום, מה קורה
The reason it looks wrong in the editor is that the overall direction of the editor is set to LTR. Strings of Hebrew/Arabic text have intrinsic left-to-right directionality that coerces them into RTL, but strings such as ** have no intrinsic directionality (hence the "start" one appears at the "end", i.e. left, of the Hebrew string); and the [b] tags have intrinsic LTR directionality due to containing Latin text, so wrapping them around a Hebrew word forces that full word to the left of the line.*
However, once rendered into HTML tags, the correct directionality is restored, as HTML tags aren't treated as text but rather elements on the page.
It might be worth adding an LTR/RTL toggle for the editor itself, to help when composing mostly-RTL posts. So then it'd look like this during composing:
Code: Select all
**שלום**, מה קורה
[b]שלום[/b], מה קורה
Note that this is still the exact same text as above! But it looks correct, because the overall direction is now RTL.
*This is an oversimplification, because the rules for how text directionality on computers works are surprisingly complex, but it captures the essence. This article is also a great intro if you're interested.