Here's the deal, I'm making a project to help teach HTML to people. Naturally, I'm afraid of that Scumbag Steve (see figure 1).
So I wanted to block ALL HTML tags, except those approved on a very specific whitelist.
Out of those approved HTML tags, I want to remove harmful attributes as well. Such as onload
and onmouseover
. Also, according to a whitelist.
I've thought of regex, but I'm pretty sure it's evil and not very helpful for the job.
Could anyone give me a nudge in the right direction?
Thanks in advance.
Fig 1.