A solution would be to filter the HTML, to make sure it's "OK" :
- Valid HTML
- That only contain the tags you want to allow
- And doesn't cause any security problem.
A great tool that does that is HTMLPurifier (quoting) :
HTML Purifier is a standards-compliant
HTML filter library written in PHP.
HTML Purifier will not only remove all
malicious code (better known as XSS)
with a thoroughly audited, secure yet
permissive whitelist, it will also
make sure your documents are
standards compliant
Basically, once the HTML has been typed by the user, before saving it to your database, you'd pass it through HTML Purifier, which will make sure it's valid, and remove any tag/attribute that you didn't specify as "allowed".