Fix the formatter and prune unmatched HTML elements