highlight.js
Advanced tools
Comparing version 9.18.4 to 9.18.5
@@ -9,9 +9,8 @@ Reset = "\x1b[0m" | ||
DEPRECATION = ` | ||
${BgRed + FgWhite} | ||
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* | ||
${Reset}${Bright}${FgWhite} | ||
DEPRECATION = `${BgRed + FgWhite}-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*${Reset} | ||
${Bright}${FgWhite} | ||
Verion 9 of Highlight.js has reached EOL. It will no longer | ||
be supported or receive security updates in the future. | ||
Please upgrade to version 10. | ||
Please upgrade to version 10 or encourage your indirect | ||
dependencies to do so. | ||
@@ -24,4 +23,6 @@ For more info: | ||
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*${Reset} | ||
.`.trim() | ||
`.trim() | ||
console.log(DEPRECATION) | ||
if (!process.env["HLJS_HIDE_UPGRADE_WARNING"]) { | ||
console.log(DEPRECATION) | ||
} |
@@ -31,7 +31,4 @@ /* | ||
}(function(hljs) { | ||
var showedUpgradeWarning = false; | ||
var warn = console.warn || console.log; | ||
warn("Version 9 of Highlight.js has reached EOL and is no longer supported. Please upgrade to version 10."); | ||
// Convenience variables for build-in objects | ||
@@ -64,2 +61,3 @@ var ArrayProto = [], | ||
var options = { | ||
hideUpgradeWarningAcceptNoSupportOrSecurityUpdates: false, | ||
classPrefix: 'hljs-', | ||
@@ -523,3 +521,10 @@ tabReplace: null, | ||
function hideUpgradeWarning() { | ||
if (options.hideUpgradeWarningAcceptNoSupportOrSecurityUpdates) | ||
return true; | ||
if (typeof process === "object" && typeof process.env === "object" && process.env["HLJS_HIDE_UPGRADE_WARNING"]) | ||
return true; | ||
} | ||
/** | ||
@@ -541,2 +546,13 @@ * Core highlighting function. | ||
function highlight(languageName, code, ignore_illegals, continuation) { | ||
if (!hideUpgradeWarning()) { | ||
if (!showedUpgradeWarning) { | ||
showedUpgradeWarning = true; | ||
console.log( | ||
"Version 9 of Highlight.js has reached EOL and is no longer supported.\n" + | ||
"Please upgrade or ask whatever dependency you are using to upgrade.\n" + | ||
"https://github.com/highlightjs/highlight.js/issues/2877" | ||
); | ||
} | ||
} | ||
var codeToHighlight = code; | ||
@@ -543,0 +559,0 @@ |
@@ -9,3 +9,3 @@ { | ||
"homepage": "https://highlightjs.org/", | ||
"version": "9.18.4", | ||
"version": "9.18.5", | ||
"author": { | ||
@@ -12,0 +12,0 @@ "name": "Ivan Sagalaev", |
@@ -365,3 +365,3 @@ # Highlight.js | ||
charset="UTF-8" | ||
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.4/languages/go.min.js"></script> | ||
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.5/languages/go.min.js"></script> | ||
``` | ||
@@ -368,0 +368,0 @@ |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
1442583
29468