Dir="auto" for composer and elsewhere

I took a stab at updating our support_mixed_text_direction setting to lean on dir="auto" instead of using a regex to parse all user input at render-time:

https://github.com/discourse/discourse/pull/26129

I think we’ll need to keep this. Setting dir="auto" on a textarea will use a heuristic to decide the direction of the entire textarea. That doesn’t sound too useful if you’re writing a post which contains a combination of rtl and ltr languages. So I think the button is required for you to switch back & forth while editing?

In cooked posts, the dir="auto" can be applied per-paragraph, which solves that problem.

Would be great if some readers / writers of RTL languages can weigh in on that, and perhaps take a look at the PR. (cc @osama - git suggests you have done a lot of work on our RTL logic)

4 Likes