News for hackers. Stuff that matters.
Re:Bidi Brackets for Dummies by msoad on Tuesday July 21, 2020 @06:00PM (#23911452)
Ok it is 2020. Let me see if I can use brackets in my text:

This is English with some فارسی(Persian) in it. Persian is also called Farsi(فارسی).

این متن به فارسی )Persian) نوشته شده

It worked but I was very confused and I'm not actually sure if position of (Persian) is right. I put it after the Farsi.

The majority Farsi line is completely butchered. Not sure if it is because this text input doesn't support RTL?

Re:Bidi Brackets for Dummies by jfk13 on Tuesday July 21, 2020 @06:13PM (#23911551)
That line has two occurrences of U+0029 RIGHT PARENTHESIS in it. I think one of them should have been U+0028.

On top of that, you really want dir=rtl on the element to give it right-to-left base directionality. If that's not an option (e.g. in a HackerNews comment), you can surround it with Unicode directional control characters U+202B RIGHT-TO-LEFT EMBEDDING .. U+202C POP DIRECTIONAL FORMATTING to make it behave correctly as a right-to-left run within a left-to-right context.