Remove invalid data in html to be generated.