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.
Login or register your account to reply
🦿 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.
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 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 Hmm, it works for the text box but not displaying that post I made, even if I apply it on the <p> tag. Maybe this is more hassle than it's worth?
7y, 1w 1 reply
Martijn It probably is. In reality, only the author knows the intended direction. And even if their browser does the right thing in the textarea you still need some way to tell the back-end what the right thing is. Of course you could load up some language recognition library and trust that one to add dir-attributes to your content: indieweb.org/langu...
7y, 1w reply