MDL-50868 weblib: add ruby support to purify_html
This commit is contained in:
+4
-1
@@ -1711,7 +1711,7 @@ function purify_html($text, $options = array()) {
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
|
||||
$config->set('HTML.DefinitionID', 'moodlehtml');
|
||||
$config->set('HTML.DefinitionRev', 2);
|
||||
$config->set('HTML.DefinitionRev', 3);
|
||||
$config->set('Cache.SerializerPath', $cachedir);
|
||||
$config->set('Cache.SerializerPermissions', $CFG->directorypermissions);
|
||||
$config->set('Core.NormalizeNewlines', false);
|
||||
@@ -1750,6 +1750,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.
|
||||
|
||||
// Use the built-in Ruby module to add annotation support.
|
||||
$def->manager->addModule(new HTMLPurifier_HTMLModule_Ruby());
|
||||
}
|
||||
|
||||
$purifier = new HTMLPurifier($config);
|
||||
|
||||
Reference in New Issue
Block a user