This is a simplistic example of user submitted HTML filtering Demo: http://giggleboxstudios.net/labs/html-filtering
NOTE: Use responsibly! This only normalizes certain features of the markup submitted by the client prior to being passed to a server side layer. Always exercise caution when passing user submitted content to your server.