> > So, all that to say, what should happen when the blog owner, or > comment poster paste invalid html? It's hard to say, but currently it will probably break. The only option would be to write an HTML parser (the kses class gets quite close to that) or use the 'tidy' extension in PHP5 if available.