This has nothing to do with bidi settings in Discourse.
When I type ->
it gets converted into an arrow character →
, so A -> B
renders as “A → B”. Pretty cool.
However, the arrow goes the wrong way in RTL text: א -> ב
renders as: “א → ב” with the arrow going the wrong way. (If you’re reading this in the future after this bug has been fixed, this was rendered as “א → ב”)
Note that the input character sequence here is:
Character | Name |
---|---|
א | HEBREW LETTER ALEF |
SPACE | |
- | HYPHEN-MINUS |
> | GREATER-THAN SIGN |
SPACE | |
ב | HEBREW LETTER BET |
which you can verify by copying the string א -> ב
into this tool: https://unicodedecode.com/
This is because arrow characters don’t bidi-mirror in Unicode. Relevant document: https://www.unicode.org/L2/L2022/22026r-non-bidi-mirroring.pdf
In particular, arrow and arrow-like characters each often has a mirror character. One could argue that they should have had the Bidi_Mirrored=Yes property value, but they don’t, and cannot now get that.
There is unfortunately no bidi-flipping arrow character, meaning that if you want to make this substitution correctly, you have to determine the bidi direction of the surrounding text to correctly pick between ← and → arrows. No easy task.