better sanitizing of text/rich directives for HTML