Anki Forums

Support for RTL layout in AnkiWeb add-on page

I’ve uploaded an Arabic add-on (1642554134) to AnkiWeb and would appreciate if divs or spans with the dir attribute were supported so that the description looks a bit prettier :slight_smile:

On a slightly unrelated note, I noticed that non-latin characters are stripped from add-on names but leading/trailing spaces are not stripped:
My add-on has the name ARLPCG (مستورد المنظومات والقصائد) and it ends up being ARLPCG in Anki (Note the trailing space).
If support for non-latin characters is not possible now, could the spaces be stripped at least?
I also think that names that consist entirely of non-latin characters will end up being empty in Anki. It seems there are no checks to prevent that in the add-on upload screen.

Thanks!

After further investigation, I found that the add-on zip is stored as ARLPCG___.zip in AnkiWeb, and the desktop client replaces the underscores with spaces as can be seen here: anki/addons.py at d2c580033b9b59c3a8f5e0e25649ba90fc0b5784 · ankitects/anki · GitHub

This was introduced in this commit: replace _ with space in add-on names · ankitects/anki@0bc4a1a · GitHub

Ok, you should be able to use dir in divs now, and the next Anki version will strip the trailing whitespace. The download endpoint avoids non-latin text and spaces, because older Anki versions didn’t support spaces, and support for non-Latin text seems to be inconsistent across the browsers

Still not able to use divs :face_with_monocle:
<div dir="rtl"> is being escaped, turning into &lt;div dir="rtl"&gt;.

Sorry, please try again.

1 Like

It works now. Thanks!