HTMLPurifier ignore WMD/ WYSIWYG code samples/tags like SO does

146 views Asked by At

I am testing a WMD editor like the one used here, on SO, to allow markup in user input. I apply HTMLPurifier on the input and it cleans all the bad tags. However, like SO, I also want to allow code samples
like this (backticks)

like this (indentation)
and even like this (with pre and code tags)

however if the user puts some nasty code in the sample, for instance:

<script>alert("annoy");</script>

the HTMLPurifier removes it.
How can I allow any user input for code samples with HTMLPurifier?


I saw this other question but the answer is just to vage

0

There are 0 answers