As you suggested, I implemented all of the code from that function into `normalizeHtml`.