Is it possible to configure HTMLPurifier to allow all classes with a certain prefix? For example, I'm using FontAwesome and would like to give the user the ability to use its icons, but there are too many to reasonably hardcode in an array.
This is what I'd like to do, but it doesn't work this way:
$config = HTMLPurifier_Config::createDefault() ;
$config->set('Attr.AllowedClasses', array('fa', 'fa-*')) ;
I found this example, which suggests that it is possible, but the code on that page doesn't actually seem to do as advertised, and some parts look wrong to me. From what I can understand of it, it only allows a
tags with a target
attribute, but not a class
attribute even though it supposedly checks for prefixed classes.