amirhhashemi / tiptap-text-direction

Text direction extension for Tiptap
https://www.npmjs.com/package/tiptap-text-direction
MIT License
38 stars 1 forks source link

[Bug] Punctuations and other characters #11

Closed svejdani closed 1 year ago

svejdani commented 1 year ago

Hello,

I was wondering if it's possible to properly align punctuations when writing English in RTL text.

Example: image

As you can see the question mark is on the wrong side and it behaves the same in the TipTap editor.

Let me know, Thanks

amirhhashemi commented 1 year ago

As far as I know, it's a problem with the Unicode Bidirectional Algorithm. Sometimes when we have a text with different directions the algorithm needs help to show the text (and especially punctuation) correctly. There are various ways that we can help the algorithm, but I can't think of an easy way to implement them in a plugin. Please read Inline markup and bidirectional text in HTML if you need more information.

Github and Lexical has the same problem. I'm not smarter than those guys so maybe there is not a solution for this yet.

svejdani commented 1 year ago

Thanks for the feedback. I do agree that it is a complex problem to solve and I haven't come across any editors that solve it correctly. Feel free to close.