mewebstudio/Purifier — pull request #5 by ceejayoz (2013-08-07 15:22:18+00:00)
Title: Allow use of multiple HTMLPurifier configs

This extends the Purifier package to allow for multiple configuration
arrays in the purifier.settings array, as well as passing a one-off
configuration array directly to Purifier::clean() as a second parameter.

Example config file:

return array(
...
'settings' => array(
'default' => array(
'HTML.Doctype' => 'XHTML 1.0 Transitional',
...
'AutoFormat.AutoParagraph' => true,
'AutoFormat.Linkify' => true,
),
'titles' => array(
'AutoFormat.AutoParagraph' => false,
'AutoFormat.Linkify' => false,
)
),
);

Example usage:

Purifier::clean('This is my H1 title', 'titles');
Purifier::clean('This is my H1 title', array('Attr.EnableID' => true));