Search code examples
phphtmlhtmlpurifier

make HTMLPurifier omit double quotes around="attributes"


This is not terribly important, but I want to find out if you can possibly have HTMLPurifier omit the double quotes around arguments. When it filters HTML it usually reformats it into XHTML syntax.

But I would prefer <div class=alphanum> rather than class="xyz" in the output - whenever possible.

The config settings http://htmlpurifier.org/live/configdoc/plain.html provide no obvious option, and I didn't bother to look through the code (500K do scare you away). HTMLPurifier does use DOMDocument at some point. I'm not sure if this is just for pre-parsing, or if it's for output serialization (then I could answer the question myself with: No).

I've glanced through the tag, found nothing. And enabling the experimental(?) HTMLPurifier/Lexer/PH5P.php parser doesn't change the output behaviour.

So is there an uncommon setting or tweak for that?


Solution

  • HTML Purifier specifically quotes all of its attributes for security reasons. There is no knob to turn it off.