Skip to content

Commit c6eb944

Browse files
author
Jordan Eldredge
committed
Allow unicode tag names and characters since that's what the tokenizer outputs
1 parent 7cce65b commit c6eb944

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

html5lib/filters/lint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __iter__(self):
2424
name = token["name"]
2525
if contentModelFlag != "PCDATA":
2626
raise LintError(_("StartTag not in PCDATA content model flag: %(tag)s") % {"tag": name})
27-
if not isinstance(name, str):
27+
if not isinstance(name, basestring):
2828
raise LintError(_("Tag name is not a string: %(tag)r") % {"tag": name})
2929
if not name:
3030
raise LintError(_("Empty tag name"))
@@ -50,7 +50,7 @@ def __iter__(self):
5050

5151
elif type == "EndTag":
5252
name = token["name"]
53-
if not isinstance(name, str):
53+
if not isinstance(name, basestring):
5454
raise LintError(_("Tag name is not a string: %(tag)r") % {"tag": name})
5555
if not name:
5656
raise LintError(_("Empty tag name"))
@@ -67,7 +67,7 @@ def __iter__(self):
6767

6868
elif type in ("Characters", "SpaceCharacters"):
6969
data = token["data"]
70-
if not isinstance(data, str):
70+
if not isinstance(data, basestring):
7171
raise LintError(_("Attribute name is not a string: %(name)r") % {"name": data})
7272
if not data:
7373
raise LintError(_("%(type)s token with empty data") % {"type": type})

0 commit comments

Comments
 (0)