From e464bf3c7d875d7cd95c3a04d74f513e209a3edc Mon Sep 17 00:00:00 2001 From: Lior Gil Date: Sun, 2 Jul 2023 09:05:27 +0300 Subject: [PATCH] MDL-76203 weblib: Add BDI support to the HTML purifier --- lib/weblib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index 29041dffb03..76cb3e92ac0 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1927,6 +1927,9 @@ function purify_html($text, $options = array()) { $def->addElement('algebra', 'Inline', 'Inline', array()); // Algebra syntax, equivalent to @@xx@@. $def->addElement('lang', 'Block', 'Flow', array(), array('lang'=>'CDATA')); // Original multilang style - only our hacked lang attribute. $def->addAttribute('span', 'xxxlang', 'CDATA'); // Current very problematic multilang. + // Enable the bidirectional isolate element and its span equivalent. + $def->addElement('bdi', 'Inline', 'Flow', 'Common'); + $def->addAttribute('span', 'dir', 'Enum#ltr,rtl,auto'); // Media elements. // https://html.spec.whatwg.org/#the-video-element