Comparing version 0.2.2 to 0.2.3
@@ -324,4 +324,5 @@ // wrapper for non-node envs | ||
var t = parser.tags.length | ||
if (!parser.strict) parser.tagName = parser.tagName[parser.tagCase]() | ||
var closeTo = parser.tagName | ||
var tagName = parser.tagName | ||
if (!parser.strict) tagName = tagName[parser.tagCase]() | ||
var closeTo = tagName | ||
while (t --) { | ||
@@ -334,4 +335,11 @@ var close = parser.tags[t] | ||
} | ||
// didn't find it. we already failed for strict, so just abort. | ||
if (t < 0) return | ||
if (t < 0) { | ||
strictFail(parser, "Unmatched closing tag: "+parser.tagName) | ||
parser.textNode += "</" + parser.tagName + ">" | ||
parser.state = S.TEXT | ||
return | ||
} | ||
parser.tagName = tagName | ||
var s = parser.tags.length | ||
@@ -527,4 +535,4 @@ while (s --> t) { | ||
} else { | ||
strictFail(parser, "Invalid comment") | ||
parser.comment += "-" + c | ||
parser.state = S.COMMENT | ||
} | ||
@@ -534,4 +542,9 @@ continue | ||
case S.COMMENT_ENDED: | ||
if (c !== ">") strictFail(parser, "Malformed comment") | ||
else parser.state = S.TEXT | ||
if (c !== ">") { | ||
strictFail(parser, "Malformed comment") | ||
// allow <!-- blah -- bloo --> in non-strict mode, | ||
// which is a comment of " blah -- bloo " | ||
parser.comment += "--" + c | ||
parser.state = S.COMMENT | ||
} else parser.state = S.TEXT | ||
continue | ||
@@ -538,0 +551,0 @@ |
{ "name" : "sax" | ||
, "author" : "Isaac Z. Schlueter <i@izs.me>" | ||
, "version" : "0.2.2" | ||
, "version" : "0.2.3" | ||
, "main" : "lib/sax" | ||
@@ -5,0 +5,0 @@ , "license" : "MIT" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132423
27
1233
20