title: How do I filter out Dangerous HTML like SO does?
body: <p>I want to provide an HTML editor on my site, but don't want to open myself up to xss or other attacks that come with allowing user-generated HTML.</p>
  
  <p>This is pretty similar to what Stack Overflow does. How is the HTML checked/sanitized here so that the styling information still remains, while other, more dangerous stuff (like javascript, iframes, etc.) are kept out?</p>
  
  <p>Are there any libraries (preferably in PHP) that already do this?</p>