Skip to content

Commit b242d88

Browse files
committed
Make sanitizer output xml-style self closing tags for self closing input
1 parent 23926b1 commit b242d88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/html5lib/sanitizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def sanitize_token(self, token):
177177
token["data"] = "<%s%s>" % (token["name"],attrs)
178178
else:
179179
token["data"] = "<%s>" % token["name"]
180-
if token["type"] == tokenTypes["EmptyTag"]:
180+
if token["selfClosing"]:
181181
token["data"]=token["data"][:-1] + "/>"
182182
token["type"] = tokenTypes["Characters"]
183183
del token["name"]

0 commit comments

Comments
 (0)