Commit 4bb58cf4 authored by Nigel McNie's avatar Nigel McNie
Browse files

Enabled auto-linking in HTML content. Some cleanup of clean_text while I was there.

parent 7f7114e2
......@@ -1991,17 +1991,17 @@ function clean_text($text) {
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache', 'SerializerPath', get_config('dataroot') . 'htmlpurifier');
$config->set('Core', 'Encoding', 'UTF-8');
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional');
$config->set('AutoFormat', 'Linkify', true);
// These settings help identify the configuration definition. If the
// definition (the $def object below) is changed (e.g. new method calls
// made on it), the DefinitionRev needs to be increased. See
$config->set('HTML', 'DefinitionID', 'Mahara customisations to default config');
// NOTE: this MUST be incremented if you change the configuration
// definition - Talk to Nigel about it
$config->set('HTML', 'DefinitionRev', 1);
// This disables caching of HTMLPurifier objects. Worth having off for
// development, but see note above once you're done messing with things
//$config->set('Core', 'DefinitionCache', null);
$config->set('Core', 'Encoding', 'UTF-8');
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional');
$def =& $config->getHTMLDefinition(true);
$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
$purifier = new HTMLPurifier($config);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment