Is there any existing addon spec for markdown that includes support for RTL languages?
What I'm hoping for is something like
This paragraph is left to right <- This paragraph is right to left
Or something... I can tweak my parser to handle this but I want to make sure it doesn't exist already.
Right-to-left languages are now supported natively in Markdown files, issues, pull requests, discussions, and comments.
Adding such support is very easy: just allow to add a tag "dir='rtl'" at the beginning of a document, and then wrap the entire document inside a "div dir='rtl'". Also today it is possible to put all text inside a "div dir='rtl'", but then it is not possible to use markdown inside.
Actually as my friend Aevyz reminded me, Markdown parses HTML in it.
You won't need to change your parser. The quickest path to solve that I could think of is this:
<div dir="rtl"> سلام دنیا مرحبا العالم שלום בעולם ہیلو دنیا </div>
So you need to add literally two lines to turn a whole document or an arbitrary section of it into RTL. It will be more compatible than an own script.
Not exactly markdown, but this is how you can override paragraph direction in StackExchange questions and answers (this method does not work for comments):
add ‫ (RIGHT-TO-LEFT EMBEDDING) in the beginning of a paragraph does control the direction of this paragraph (auto-reset on <br/> or empty line):
‫test מה זה? YES<br/> test1 מה זה? NO test2 מה זה? NO ‫test1 מה זה? YES test2 מה זה? YES
test מה זה? YES
test1 מה זה? NO test2 מה זה? NOtest1 מה זה? YES test2 מה זה? YES
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With