|
8 | 8 | _ = gettext.gettext |
9 | 9 |
|
10 | 10 | from constants import contentModelFlags, spaceCharacters |
11 | | -from constants import entitiesWindows1252, entities, voidElements |
| 11 | +from constants import entitiesWindows1252, entities |
12 | 12 | from constants import asciiLowercase, asciiLetters |
13 | 13 | from constants import digits, hexDigits, EOF |
14 | 14 |
|
@@ -87,27 +87,19 @@ def __iter__(self): |
87 | 87 |
|
88 | 88 | # Below are various helper functions the tokenizer states use worked out. |
89 | 89 | def processSolidusInTag(self): |
90 | | - """When a solidus (/) is encountered within a tag name what happens |
91 | | - depends on whether the current tag name matches that of a void element. |
92 | | - If it matches a void element atheists did the wrong thing and if it |
93 | | - doesn't it's wrong for everyone. |
| 90 | + """If the next character is a '>', convert the currentToken into |
| 91 | + an EmptyTag |
94 | 92 | """ |
95 | 93 |
|
96 | | - # We need to consume another character to make sure it's a ">" before |
97 | | - # throwing an atheist parse error. |
| 94 | + # We need to consume another character to make sure it's a ">" |
98 | 95 | data = self.stream.char() |
99 | 96 |
|
100 | | - if self.currentToken["name"] in voidElements and data == u">": |
101 | | - self.tokenQueue.append({"type": "AtheistParseError", "data": |
102 | | - _("Solidus (/) incorrectly placed in tag (atheists only).")}) |
| 97 | + if self.currentToken["type"] == "StartTag" and data == u">": |
| 98 | + self.currentToken["type"] = "EmptyTag" |
103 | 99 | else: |
104 | 100 | self.tokenQueue.append({"type": "ParseError", "data": |
105 | 101 | _("Solidus (/) incorrectly placed in tag.")}) |
106 | 102 |
|
107 | | - # XML/XHTML enablement hook |
108 | | - if self.currentToken["type"] == "StartTag" and data == u">": |
109 | | - self.currentToken["type"] = "EmptyTag" |
110 | | - |
111 | 103 | # The character we just consumed need to be put back on the stack so it |
112 | 104 | # doesn't get lost... |
113 | 105 | self.stream.queue.append(data) |
|
0 commit comments