markdown-pro icon indicating copy to clipboard operation
markdown-pro copied to clipboard

Please add RTL support in other editors

Open tareefdev opened this issue 7 years ago • 9 comments

Hi there I just met Standard Notes yesterday, and I really impressed, because it's the only app which supports:

  • Both client and server are open sources (not like Simplenote where the only clients are open sources).
  • RTL languages (not like Simplenote, Laverna, Paperwork which they didn't support RTL).
  • Offer hosted plan (free and paid) so I can choose between hosting my instance or sign up on the official server (not like Laverna, Paperwork where you have to implement and run your instance)
  • End-to-End encryption and extensions!

I instantly signed up for the extended plan, and it's really fantastic, the only (and critical) problem with it: those other editors (all of them) don't support RTL, only the default editor is do.

Please add RTL support in other editors

tareefdev avatar Feb 09 '18 15:02 tareefdev

Hey Tareef, welcome, glad you're enjoying it! Good point, RTL was added several months ago on the plain editor but not the extensions. I'll take a look now. I think we can definitely get RTL for most of the editors, but I'll have to double check. Thanks for the heads up!

moughxyz avatar Feb 09 '18 15:02 moughxyz

Hi @mobitar Thanks! It would be amazing if RTL can be added to other editors.. please update this issue when you have news

tareefdev avatar Feb 09 '18 16:02 tareefdev

So I took a look and I'm afraid none of the underlying editors (like CodeMirror) offer automatic bidirectional support. So this will be tricky to add. Does your operating system offer the choice to switch a text field's direction? I found some filler text and tested with the Advanced Markdown Editor. You can do something like this on Mac natively:

screen shot 2018-02-09 at 1 53 27 pm

moughxyz avatar Feb 09 '18 19:02 moughxyz

none of the underlying editors (like CodeMirror) offer automatic bidirectional support

So maybe I have to connect to upstream of some of these editors? Could you help me with some links?

Does your operating system offer the choice to switch a text field's direction?

Actually, I use Fedora (the last release), when I'm making a right click in ST desktop app nothing appear, anyway I found the "Writing Direction" option in Chrome, but it works only with the default editor.

screenshot from 2018-02-09 23-26-31

thanks to ST team, at least we have RTL support in the default editor which is absolutely fantastic :)

tareefdev avatar Feb 09 '18 20:02 tareefdev

Hmm strange. All of these editors are based on CodeMirror: Advanced Markdown, Minimal Markdown, Plus Editor, Code Editor, and Vim Editor. So our solution is with CodeMirror. They have an option to specify RTL during initialization, but not automatically as you type:

https://codemirror.net/demo/bidi.html

Check out the page source for how they do it, pretty straightforward. But it's not straightforward to introduce a new UI element for setting RTL on top of these editors, since the code we use does not override their UI, but just presents it on the page.

moughxyz avatar Feb 09 '18 20:02 moughxyz

Check out the page source for how they do it, pretty straightforward. But it's not straightforward to introduce a new UI element

Can we add that little code as a new installable "Component" for Standard Notes, so after installed it users can enable an option to make direction from right to left for one note or all of them?

tareefdev avatar Feb 09 '18 20:02 tareefdev

No, that wouldn't work. Extensions are mostly self-contained and can't influence one another. So we'd have to make a special RTL Markdown Editor to do this.

moughxyz avatar Feb 11 '18 14:02 moughxyz

Hi @mobitar It would be great if we can have an advanced markdown editor which supports RTL so that SN will be full-featured app for RTL languages users. Please update this issue later when the new editor will be available. Thanks for your help.

tareefdev avatar Feb 11 '18 16:02 tareefdev

Will do, thanks!

moughxyz avatar Feb 12 '18 18:02 moughxyz