html: track the end tags and report mismatched nodes