8000 Fix treewalkers to never generate DOCTYPE tokens with None as the nam… · awesome-python/html5lib-python@b08102b · GitHub
[go: up one dir, main page]

Skip to content

Commit b08102b

Browse files
committed
Fix treewalkers to never generate DOCTYPE tokens with None as the name (replaced with an empty unicode string)
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40882
1 parent fcf0d4a commit b08102b

File tree

1 file changed

+2
-1
C576 lines changed

1 file changed

+2
-1
lines changed

src/html5lib/treewalkers/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def comment(self, data):
5252
return {"type": "Comment", "data": unicode(data)}
5353

5454
def doctype(self, name, publicId=None, systemId=None, correct=True):
55-
return {"type": "Doctype", "name": name and unicode(name) or None,
55+
return {"type": "Doctype",
56+
"name": name is not None and unicode(name) or u"",
5657
"publicId": publicId, "systemId": systemId,
5758
"correct": correct}
5859

0 commit comments

Comments
 (0)
0