Skip to content

Feature Request: RTL support #421

Closed
Closed

Description

@mrg0lden

Description

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

image

Arabic text should start from right and ends to left.

Versions

  • Mark Text: 0.12.25
  • OS: Windows 10 1804 64bit

Activity

  1. Jocs commented on Jul 12, 2018

    @Jocs
    Member

    Being able to change direction, or at best the editor can manage text direction automatically

    How editor can manage text direction automatically?

  2. added
    🦄 feature request
    on Jul 12, 2018
  3. mrg0lden commented on Jul 12, 2018

    @mrg0lden
    Author

    @Jocs If it uses HTML viewer as I think, we can add the attribute dir="auto" which will handle directions perfectly.

  4. Jocs commented on Jul 17, 2018

    @Jocs
    Member

    @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.

  5. added
    🐳 help wanted
    on Jul 17, 2018
  6. mohsenkhanpour commented on Jul 20, 2018

    @mohsenkhanpour

    Please implement this feature. I can help with testing if someone can submit a PR.

  7. Jocs commented on Jul 20, 2018

    @Jocs
    Member

    @mohsenkhanpour Do you also have such demand?

  8. mohsenkhanpour commented on Jul 20, 2018

    @mohsenkhanpour

    @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/

  9. fxha commented on Jul 20, 2018

    @fxha
    Contributor

    One question: is the text saved "normal" (left-to-right) and only displayed RTL?

  10. mohsenkhanpour commented on Jul 20, 2018

    @mohsenkhanpour

    @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.
    screenshot_1
    After applying this code with a custom CSS extension:

    screenshot_2

    The text is shown currently.
    screenshot_3

  11. mrg0lden commented on Jul 22, 2018

    @mrg0lden
    Author

    @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?

  12. Jocs commented on Jul 22, 2018

    @Jocs
    Member

    @mrg0lden I think you don't need electron experience, but you need some html\css knowledge.

  13. Jocs commented on Jul 22, 2018

    @Jocs
    Member

    @fxha Is it needed to add a menu item to select ltr or rtl ? or any other ideas?

  14. fxha commented on Jul 22, 2018

    @fxha
    Contributor

    @Jocs Yeah I think it's the best to add a settings option and a dynamic direction (ltr or rtf) to the editor HTML element.

  15. mohsenkhanpour commented on Jul 22, 2018

    @mohsenkhanpour

    @Jocs @fxha I just did the same test with dir:auto and it didn't fix the content. So I agree with you on putting an option in the menu.

  16. 1 remaining item

  17. enyaxu commented on Jul 23, 2018

    @enyaxu
    Contributor

    Seems that we need add menu and option for control text direction, I will push a request later. So we could discuss further more.

  18. Jocs commented on Jul 23, 2018

    @Jocs
    Member

    @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.

  19. enyaxu commented on Jul 23, 2018

    @enyaxu
    Contributor

    @Jocs Thank you for your suggestions.

  20. mrg0lden commented on Jul 23, 2018

    @mrg0lden
    Author

    @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).

  21. mrg0lden commented on Jul 23, 2018

    @mrg0lden
    Author

    @mohsenkhanpour Just wanted to ensure that dir=auto is an attribute not a css property
    <p dir=auto editable>test</p> <p dir=auto editable>تجربة</p>

    a working example: http://jsfiddle.net/fwxg3ute/

  22. enyaxu commented on Jul 25, 2018

    @enyaxu
    Contributor

    Push a request, please test.

  23. Jocs commented on Jul 26, 2018

    @Jocs
    Member

    @enyaxu ok, thanks.

  24. added a commit that references this issue on Aug 12, 2018
  25. added
    🐝 resolved/fixed but not released
    on Aug 12, 2018
  26. mohamnag commented on Aug 16, 2021

    @mohamnag

    it this supported only on win? I don't see any menu item to switch direction on mac.

  27. mshamaseen commented on Aug 7, 2024

    @mshamaseen

    Hmm, how can I make the direction RTL? I'm using Linux but i can't find the option on the edit menu

  28. Enlight432 commented on Jul 19, 2025

    @Enlight432

    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

  29. added a commit that references this issue on Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐝 resolved/fixed but not released🦄 feature request🐳 help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions