Skip to content

Commit ca695c7

Browse files
author
Jordan Eldredge
committed
Only look for attributes in StartTags
1 parent 7cce65b commit ca695c7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

html5lib/filters/lint.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def __iter__(self):
3434
raise LintError(_("Non-void element reported as EmptyTag token: %(tag)s") % {"tag": token["name"]})
3535
if type == "StartTag":
3636
open_elements.append(name)
37-
for name, value in token["data"]:
38-
if not isinstance(name, str):
39-
raise LintError(_("Attribute name is not a string: %(name)r") % {"name": name})
40-
if not name:
41-
raise LintError(_("Empty attribute name"))
42-
if not isinstance(value, str):
43-
raise LintError(_("Attribute value is not a string: %(value)r") % {"value": value})
37+
for name, value in token["data"]:
38+
if not isinstance(name, str):
39+
raise LintError(_("Attribute name is not a string: %(name)r") % {"name": name})
40+
if not name:
41+
raise LintError(_("Empty attribute name"))
42+
if not isinstance(value, str):
43+
raise LintError(_("Attribute value is not a string: %(value)r") % {"value": value})
4444
if name in cdataElements:
4545
contentModelFlag = "CDATA"
4646
elif name in rcdataElements:

0 commit comments

Comments
 (0)