# RTL Languages Support

**URL:** <https://talk.commonmark.org/t/rtl-languages-support/203>\
**Category:** Implementation\
**Created:** [September 4, 2014, 3:25am UTC](https://talk.commonmark.org/t/rtl-languages-support/203 "2014-09-04T03:25:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![obeid](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/o/8dc957/32.png) [@obeid](https://talk.commonmark.org/u/obeid)\
**Post date:** [September 4, 2014, 3:25am UTC](https://talk.commonmark.org/t/rtl-languages-support/203/1 "2014-09-04T03:25:03Z")

</div>

It’s mind-blowing that not a single flavor of markdown tried to address the localization issue. RTL (right-to-left) languages should be represented correctly in the rendered document (HTML or not). There’s been fragmented discussions on how to best work that in, some suggested using some right-pointing brackets ‘\>’ before any RTL text and others chimed in variations of that.

I believe text in RTL languages should be treated just like any other text, except when rendered, where the parser should hopefully have a mechanism to detect RTL text blocks and adding the necessary ‘dir=“rtl”’ paragraphs.

Twitter has a js library that detects if the text being entered in from an RTL language and adjusts the direction directly. [https://github.com/twitter/RTLtextarea](https://github.com/twitter/RTLtextarea) Something like that should be worked into the parser itself.

---

<div class="post-metadata">

**Author:** ![mangecoeur](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mangecoeur/32/355_2.png) [@mangecoeur](https://talk.commonmark.org/u/mangecoeur)\
**Post date:** [September 15, 2014, 2:23pm UTC](https://talk.commonmark.org/t/rtl-languages-support/203/2 "2014-09-15T14:23:23Z")

</div>

Good point. I suppose one big question is whether an RTL mode should enable you to write Markdown special syntax RTL too, since otherwise when you are typing RTL you’ll have to write them “backwards”.

So for example in RTL mode an image link like `hello world ![alt text](http://blah.com)`

could be this:

`(http://blah.com)[alt text]! مرحبا العالم`

(disclaimer - arabic supposedly says “hello world” according to google, no way to verify)  
Although since URLs remain LTR you get an odd mix of text directions.

---

<div class="post-metadata">

**Author:** ![mb21](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mb21/32/162_2.png) [@mb21](https://talk.commonmark.org/u/mb21)\
**Post date:** [September 16, 2014, 8:15am UTC](https://talk.commonmark.org/t/rtl-languages-support/203/3 "2014-09-16T08:15:16Z")

</div>

Note that there is already a [topic about RTL](http://talk.commonmark.org/t/explicit-rtl-indication-in-pure-markdown/286).

---

<div class="post-metadata">

**Author:** ![ahangarha](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/a/4da419/32.png) [@ahangarha](https://talk.commonmark.org/u/ahangarha)\
**Post date:** [October 6, 2019, 1:40pm UTC](https://talk.commonmark.org/t/rtl-languages-support/203/4 "2019-10-06T13:40:50Z")

</div>

I have shared my thought on this matter here: [Explicit RTL indication in pure Markdown](https://talk.commonmark.org/t/explicit-rtl-indication-in-pure-markdown/286/15)

---

<div class="post-metadata">

**Author:** ![ahangarha](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/a/4da419/32.png) [@ahangarha](https://talk.commonmark.org/u/ahangarha)\
**Post date:** [May 3, 2020, 7:43am UTC](https://talk.commonmark.org/t/rtl-languages-support/203/5 "2020-05-03T07:43:02Z")

</div>

As per my experience and over a year following this issue, applying `dir="auto"` and in some cases applying `unicode-bidi: plaintext` solves 99% problem.

I have made a very simple Firefox add-on which applies `dir=auto` and `text-align: start` to headings and paragraphs of all pages. It works almost perfect in most of the cases. I have put some screenshot of how it works well in github for instance.

Please find it here and share your comments with me.

> **[Add Bidi Support – Get this Extension for 🦊 Firefox (en-US)](https://addons.mozilla.org/en-US/firefox/addon/add-bidi-support/)**
>
> Download Add Bidi Support for Firefox. This extension applies some modification in websites in order to add bidirectional support to them.

My idea for this add-on was to show how easily we can handle this issue universally and perhaps provide a simple but practical guideline for handling such issues. I hope soon there be no need for such add-ons.

---

<div class="post-metadata">

**Author:** ![ahangarha](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/a/4da419/32.png) [@ahangarha](https://talk.commonmark.org/u/ahangarha)\
**Post date:** [November 13, 2021, 6:25pm UTC](https://talk.commonmark.org/t/rtl-languages-support/203/6 "2021-11-13T18:25:25Z")

</div>

I just want to inform all of you that long after Gitlab, Github also took the approach of using `dir="auto"` of tags to make them render text in relevant direction based on their content.

This is a so far the best approach I am came across and I don’t know why it doens’t become the standard way of parsing md into html.

Regarding editors, of course we need to ask them to add bidi support in the same way (consider the first strong character to determine direction of the text). Some editors (like Gedit or Kate) already support it. Others should also do. If they don’t there will be no way to properly make RTL markdown documents which is bad for sure.
