highlight.js
Advanced tools
Comparing version 10.0.1 to 10.0.2
@@ -867,3 +867,3 @@ // https://github.com/substack/deep-freeze/blob/master/index.js | ||
var version = "10.0.1"; | ||
var version = "10.0.2"; | ||
@@ -1212,2 +1212,19 @@ /* | ||
// edge case for when illegal matches $ (end of line) which is technically | ||
// a 0 width match but not a begin/end match so it's not caught by the | ||
// first handler (when ignoreIllegals is true) | ||
if (match.type === "illegal" && lexeme === "") { | ||
// advance so we aren't stuck in an infinite loop | ||
return 1; | ||
} | ||
// infinite loops are BAD, this is a last ditch catch all. if we have a | ||
// decent number of iterations yet our index (cursor position in our | ||
// parsing) still 3x behind our index then something is very wrong | ||
// so we bail | ||
if (iterations > 100000 && iterations > match.index * 3) { | ||
const err = new Error('potential infinite loop, way more iterations than matches'); | ||
throw err; | ||
} | ||
/* | ||
@@ -1243,9 +1260,13 @@ Why might be find ourselves here? Only one occasion now. An end match that was | ||
var relevance = 0; | ||
var match, processedCount, index = 0; | ||
var match; | ||
var processedCount; | ||
var index = 0; | ||
var iterations = 0; | ||
var continueScanAtSamePosition = false; | ||
try { | ||
var continueScanAtSamePosition = false; | ||
top.matcher.considerAll(); | ||
while (true) { | ||
for (;;) { | ||
iterations++; | ||
if (continueScanAtSamePosition) { | ||
@@ -1252,0 +1273,0 @@ continueScanAtSamePosition = false; |
@@ -9,3 +9,3 @@ { | ||
"homepage": "https://highlightjs.org/", | ||
"version": "10.0.1", | ||
"version": "10.0.2", | ||
"author": { | ||
@@ -12,0 +12,0 @@ "name": "Ivan Sagalaev", |
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
1453795
31952