You want wiki(pedia) to generate valid HTML pages ?
Then there is only one answer: forbid authors to write HTML in their articles. Or at least don't call it 'html', it confuses everybody (even people on this list), instead, incorporate those tags into the Wiki-syntax and define them as Wiki-markup-codes: document them and ban all other HTML-markup-codes.
Pieter Suurmond