Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bidi not supported in Squire editor #1158

Closed
rezaei92 opened this issue Jun 3, 2023 · 6 comments
Closed

Bidi not supported in Squire editor #1158

rezaei92 opened this issue Jun 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@rezaei92
Copy link

rezaei92 commented Jun 3, 2023

Hello
As you mentioned in #630, would you please add the new version of CKEditor (CKEditor 5) to Snappymail?

The bidi buttons are needed for RTL based languages such as Persian, Hebrew and Arabic, but this is not supported in Squire editor.

I'm also trying to do this and if I succeed, I will send these changes as a PR.

@the-djmaze
Copy link
Owner

There are several options:

  1. As HTML element attribute dir="ltr", dir="rtl", dir="auto"
  2. As CSS direction but discouraged https://developer.mozilla.org/en-US/docs/Web/CSS/direction

A more important part is the CSS unicode-bidi which you can read in detail at https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-bidi

However, when writing a plain text message, instead of HTML, the above mentioned options are useless.

So, when thinking about that. Would the following on the squire-wysiwyg be enough?

<div class="squire-wysiwyg" dir="auto" style="unicode-bidi: plaintext">

@the-djmaze the-djmaze added the enhancement New feature or request label Jun 5, 2023
@rezaei92
Copy link
Author

rezaei92 commented Jun 6, 2023

Finally, it doesn't solve the issue because there are instances where users need to specify the text direction manually.

For example, a user might write a Persian paragraph that begins with an English word and want to set RTL direction.

An example of such a sentence is:
'Sample به معنای نمونه هست.'

I want to specify the RTL direction for this sentence, but since it starts with an English word, browsers automatically align it to the LTR direction, that's not good.

Therefore, I want to specify the text direction for certain paragraphs.

Additionally, there are many cases where the target webmail doesn't support automatic text direction detection, and we must manually specify the direction in HTML tags.

For example, some legacy email services lack automatic text direction detection, resulting in wrong text direction.

@the-djmaze
Copy link
Owner

Good examples!
Will add something to Squire.
Would all option values be the best?

  • ltr
  • rtl
  • auto
  • (empty/undefine)

@rezaei92
Copy link
Author

rezaei92 commented Jun 7, 2023

Sounds good, thank you.

When do you think this feature will be added to Squire?
What does empty/undefined option do?
Is it used to write emails in plain text mode?

the-djmaze pushed a commit that referenced this issue Jun 12, 2023
@the-djmaze
Copy link
Owner

I've made some changes and added to the demo.
Feel free if this is something you want.
afbeelding

@rezaei92
Copy link
Author

rezaei92 commented Jul 2, 2023

I appreciate you taking the time to add this feature, but unfortunately, it is not functioning properly.

Hence, I sent the required changes as a PR #1200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants