So what's the next step? Should I create github issue for implementing this in Joplin?
Yes the best is to open an issue on GitHub that sums up what we discussed here. I can make it a “good first issue” next, since it’s not too complex.
Another update: I opened an issue with markdown-it. They closed it almost immediately though.
Can a template be created as a shorthand to insert div=rtl
or div=auto
?
I want to address another issue with RTL languages. Preposition and article words tend to take the form of a prefix letter. For example in Hebrew מרומא
, transliterated “miRoma”, means “from Rome”. These means that the search function of Joplin is inadequate. If I search for רומא
, Rome, I’ll only get results where the word was written without any preposition.
In other words these languages require stemming functions that go in both directions. A partial string match is a solution, but I get it might have undesirable matches too. Adding exceptions for the relevant prefix letters is an option, I don’t know how well that fits with the code. Another option is using regex search. Somewhat more taxing for the user, but has it’s killer advantages. It’s high on my wishlist.
+1
What I did is using the Template plugin in Joplin (GitHub - joplin/plugin-templates: Create templates in Joplin and use them to create new notes and todos.) to create a shortcut to add the CSS command directly into my note. The CSS command I am using is:
<span lang="ar" style="direction: rtl; font-size: 120%">
some arabic text
</span>
This way I can not only set the direction, but also the text size and since I am using span and not div, I can use both, RTL and LTR after or before the arabic text. So it doesn't affect other text.