diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -402,6 +402,15 @@
self._run_check(html, expected, collector=self.get_collector())
+ def test_with_malformed_attributes(self):
+ # see #12629
+ for html in ['