Hi,
I strongly believe that RTL in Markdown should be explicit, and has its own syntax indication within the markdown document itself.
##Why?
The current state of writing non-LTR documents with Markdown is simply awful… there’s no way you can say this element or document is RTL. hence any RTL document will result is messed text, especially if there are Latin words within the RTL text. Some think there’s no problem and this is abstracted away by Unicode or something… but Unicode does NOT handle direction…
Is this implementation/render-specific ?
Some folks say: man just put dir='auto'
in the resulted HTML, let the browser do the work and you’re done! others suggest to make the parser detect the language being parsed and its direction… but this won’t cover the majority of cases… it just won’t help it…
Example:
First, to understand what I mean, compare the following 2 <code>
blocks, the first without dir="rtl"
and the second one with:
أسكن في SidiAmar, Annaba, Algeria.
أسكن في SidiAmar, Annaba, Algeria.
The first one is the current state. Some parser or language detectors (Like Facebook comments) detect the content’s language and decide its direction… but the majority of them (like in Facebook) count the RTL words and the Latin words, the higher wins, like in our example above sum(Latin words) > sum(Arabic words), thus the text is LTR, but it is NOT.
dir="auto"
is a bit smarter, it surely helps, but unreliable… here’s why:
Sidi Amar, Annaba, Algeria، هذا مقر سكني
Inspect the above <code>
element. It has dir="auto"
. Did it help? surely no, because it thinks it is LTR as it start with Latin words, but the text is intended to be RTL. Now change it to dir="rtl"
to see what I mean.
Conclusion
RTL needs to have an explicit indication in Markdown regardless the content language… the examples I gave are very narrowed, there are other use cases where it really needs RTL explicit indication… (think about editors as well, how one can write RTL in markdown editors?)
If we want to spread Markdown in Wikis, documentation, books… etc, this needs to be in spec due to its importance…
Spec example:
<--rtl-- Foo
Bar
Would result into:
Foo Bar
<p dir="rtl">Foo
Bar</p>
Thanks.