-
Improvement
-
Resolution: Fixed
-
Major
-
3.9.17, 3.11.10, 4.0.4, 4.2
-
MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_402_STABLE
-
MOODLE_403_STABLE
-
-
1
-
Team Hedgehog 2023 Sprint 2.1, Team Hedgehog 2023 Sprint 2.2, Team Hedgehog 2023 Sprint 2.3
For many users with RTL languages, it's quite the challenge to write text that combines LTR words, or even a set of numbers without breaking the text flow. This is easily resolved in all word processing programs, but not in web pages.
A solution does exist in the form of the BDI tag which is supported in all major browsers.
Although HTML Purifier comes with BDO support, this is a different tag that won't be more suitable for text editors.
Adding the BDI support will set the grounds for easily creating or even just reading LTR content within RTL, and vise versa.
I myself have no experience with the HTMLPurifier but it seems that it can be achieved by adding these two definitions in the purify_html() function:
$def->addAttribute('span', 'dir', 'Enum#ltr,rtl,auto');
$def->addElement('bdi', 'Inline', 'Flow', 'Common');
This will add the BDI tag as well as its 'dir' attribute equivalent.