Add input validation for html param in setHTML() 

Enhancement to feature branch dont-die-on-bad-html:
Add input validation for html param in setHTML(), see my comment on #1449

This also fixes a duplicate doc entry in the dont-die-on-bad-html branch.