You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for writing from Right-To-Left for RTL languages such as Arabic and Hebrw
[Description of the bug or feature]
Expected behavior: [What you expected to happen]
Being able to change direction, or at best the editor can manage text direction automatically ([dir=auto]).
Actual behavior: [What actually happened]
There's no way to change text direction as of the time this issue was opened.
Link to an example: [If you're reporting a bug that's not reproducible, or it's hard to description, please paste a screenshot of reproducing this issue, gif format is appropriate]
This is how it looks now
Arabic text should start from right and ends to left.
@mrg0lden I think this is a very good demand and there should be a lot of people who need it, but my usual way of writing is left to right. I am not very good at testing. So I prefer to have a contributor who can submit a PR, which is the best.
@Jocs Yes.
I can live with the text being aligned to left however my main problem is when I am using a rtl language and add an English word, it breaks the whole style and the text is not readable anymore.
@fxha Yes. definitely. It's more a matter of styling rather than programming.
When I copy the text from these editors and paste into Mark Text or VSCode, the words will jumble up. However when I use them in a Jekyll blog they show correctly.
To further clarify:
This text is one saved markdown file hosted on GitHub. (Viewed on GitHub too.)
It shows how adding an English word jumbles up the whole content.
After applying this code with a custom CSS extension:
@enyaxu Ok, As we discussed, first we need to add a default configuration to the user preference, and we can modify the writing direction of the currently edited document in the menu. The options in menu item do not affect the configuration in user preference, you can refer to line ending implement.
@Jocs Can't we actaully have a direction per paragraph? (or tags such as <p><h1> etc)
In chrome there's something similar to that, in input fields I can change the direction by right clicking on the field or by a shortcut (ctrl+shift).
Activity
Jocs commentedon Jul 12, 2018
How editor can manage text direction automatically?
mrg0lden commentedon Jul 12, 2018
@Jocs If it uses HTML viewer as I think, we can add the attribute
dir="auto"which will handle directions perfectly.Jocs commentedon Jul 17, 2018
@mrg0lden I think this is a very good demand and there should be a lot of people who need it, but my usual way of writing is left to right. I am not very good at testing. So I prefer to have a contributor who can submit a PR, which is the best.
mohsenkhanpour commentedon Jul 20, 2018
Please implement this feature. I can help with testing if someone can submit a PR.
Jocs commentedon Jul 20, 2018
@mohsenkhanpour Do you also have such demand?
mohsenkhanpour commentedon Jul 20, 2018
@Jocs Yes.
I can live with the text being aligned to left however my main problem is when I am using a rtl language and add an English word, it breaks the whole style and the text is not readable anymore.
@mrg0lden A fast and quick solution is using an online rtl markdown editor and copying the text into marktext.
http://www.sobhe.ir/moratab/
http://dariubs.github.io/rtlmd/
fxha commentedon Jul 20, 2018
One question: is the text saved "normal" (left-to-right) and only displayed RTL?
mohsenkhanpour commentedon Jul 20, 2018
@fxha Yes. definitely. It's more a matter of styling rather than programming.
When I copy the text from these editors and paste into Mark Text or VSCode, the words will jumble up. However when I use them in a Jekyll blog they show correctly.
To further clarify:

This text is one saved markdown file hosted on GitHub. (Viewed on GitHub too.)
It shows how adding an English word jumbles up the whole content.
After applying this code with a custom CSS extension:
The text is shown currently.

mrg0lden commentedon Jul 22, 2018
@Jocs I'd like to help, but I find myself lost in the source code xD. I'd appreciate any kind of clues.
Do I need previous electron experience?
Jocs commentedon Jul 22, 2018
@mrg0lden I think you don't need electron experience, but you need some html\css knowledge.
Jocs commentedon Jul 22, 2018
@fxha Is it needed to add a menu item to select
ltrorrtl? or any other ideas?fxha commentedon Jul 22, 2018
@Jocs Yeah I think it's the best to add a settings option and a dynamic direction (
ltrorrtf) to the editor HTML element.mohsenkhanpour commentedon Jul 22, 2018
@Jocs @fxha I just did the same test with
dir:autoand it didn't fix the content. So I agree with you on putting an option in the menu.1 remaining item
enyaxu commentedon Jul 23, 2018
Seems that we need add menu and option for control text direction, I will push a request later. So we could discuss further more.
Jocs commentedon Jul 23, 2018
@enyaxu Ok, As we discussed, first we need to add a default configuration to the user preference, and we can modify the writing direction of the currently edited document in the menu. The options in menu item do not affect the configuration in user preference, you can refer to line ending implement.
enyaxu commentedon Jul 23, 2018
@Jocs Thank you for your suggestions.
mrg0lden commentedon Jul 23, 2018
@Jocs Can't we actaully have a direction per paragraph? (or tags such as
<p><h1>etc)In chrome there's something similar to that, in input fields I can change the direction by right clicking on the field or by a shortcut (ctrl+shift).
mrg0lden commentedon Jul 23, 2018
@mohsenkhanpour Just wanted to ensure that
dir=autois an attribute not a css property<p dir=auto editable>test</p> <p dir=auto editable>تجربة</p>a working example: http://jsfiddle.net/fwxg3ute/
enyaxu commentedon Jul 25, 2018
Push a request, please test.
Jocs commentedon Jul 26, 2018
@enyaxu ok, thanks.
#421 Add experiment function RTL support (#439)
talothman commentedon Sep 7, 2018
Examples:
https://codepen.io/siamak/pen/rAmBb
https://github.com/hasenj/bidiweb
mohamnag commentedon Aug 16, 2021
it this supported only on win? I don't see any menu item to switch direction on mac.
mshamaseen commentedon Aug 7, 2024
Hmm, how can I make the direction RTL? I'm using Linux but i can't find the option on the edit menu
Enlight432 commentedon Jul 19, 2025
This problem can be solved with HTML when writing in MarkText, but it's troublesome, tiring, and repetitive. I hope this problem is solved by default
marktext#421 Add experiment function RTL support (marktext#439)