Mark Dain Sublevel doesn't have right-to-left support :( I don't know if the Unicode character is required, I believe iOS outputs one when you change keyboard
🦿 Lucian Marin I believe CSS support is necessary. Basically I need to autodetect right-to-left text and apply a CSS class.
Mark Dain Hmm, that could be tricky, especially with mixed sentences. I wonder if we could detect if the sentence starts with the Unicode right-to-left mark (UTF8: E2 80 8F / ‏). any ideas how best to tackle this?
Martijn Auto-detection and CSS on mixed direction text! Hahahahaha... haha... ha..? Oh, you weren't joking? The I invite you (and of course) to read w3.org/Internation... The whole page is pretty on point, but for Sublevel the heading "Handling content whose direction is not known in advance" is the important one. Adding dir="auto" on the textarea and pasting in does put it as RTL in my browser. I haven't done any further testing. I only know the theory, haven't actually had to implement any of this, ever.
🦿 Lucian Marin It can be reported to the server using `dirname` attribute. On the server I can set RTL as a boolean value for each reply/update. So the problem can be solved, . There's no need for hacks.
Login or register your account to reply
Martijn Yes, that's described in the article I linked. But do note that it is only supported by WebKit based browsers. According to the W3, not even Firefox supports it. And I don't know if they even test mobile browsers, so that will be interesting to see.
7y, 1w reply
Mark Dain Oohh that's neat! If you add that and dir="auto" to the input, please let me know and I'll test again. For longer paragraphs of <rtl language> it should look less weird; if you manually set text-align: right on the 2 words I posted looks really out of place. I'll see if I can dig up some sample sentences (I'm not remotely fluent so I can't just write something) --
Martijn I would set `dir="rtl"` on the entry's content and target that for custom right-to-left CSS. Just a little bit more semantically correct than adding another class. Not sure if you even need the `text-align` in that case?
7y, 1w 1 reply