Skip to content

Commit 20aa078

Browse files
committed
We should treat tags marked as self-closing as void.
See #6 here: http://w3c.github.io/html/syntax.html#start-tags. Any foreign element can be mark itself as self-closing. We should support this.
1 parent eeb117b commit 20aa078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/parse-tag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = function (tag) {
1717
key = match;
1818
} else {
1919
if (i === 0) {
20-
if (voidElements[match]) {
20+
if (voidElements[match] || tag.charAt(tag.length - 2) === '/') {
2121
res.voidElement = true;
2222
}
2323
res.name = match;

0 commit comments

Comments
 (0)