I have to parse HTML and "HTML" from emails. I\'ve already managed to create a function that cleans most of the errors such as improper nesting of elements.