[epiphany/mcatanzaro/highlightjs-11.4.0] Update to highlight.js 11.4.0




commit 0a648f00b500b064089a33de2903564f99ef7d7f
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Thu Jan 6 11:06:03 2022 -0600

    Update to highlight.js 11.4.0

 third-party/highlightjs/highlight.js | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/third-party/highlightjs/highlight.js b/third-party/highlightjs/highlight.js
index da59842e3..68d0ac30a 100644
--- a/third-party/highlightjs/highlight.js
+++ b/third-party/highlightjs/highlight.js
@@ -1,6 +1,6 @@
 /*!
-  Highlight.js v11.3.1 (git: 2a972d8658)
-  (c) 2006-2021 Ivan Sagalaev and other contributors
+  Highlight.js v11.4.0 (git: 2d0e7c1094)
+  (c) 2006-2022 Ivan Sagalaev and other contributors
   License: BSD-3-Clause
  */
 var hljs = (function () {
@@ -428,11 +428,13 @@ var hljs = (function () {
       }
     }
 
+    /** @typedef { {capture?: boolean} } RegexEitherOptions */
+
     /**
      * Any of the passed expresssions may match
      *
      * Creates a huge this | this | that | that match
-     * @param {(RegExp | string)[] } args
+     * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args
      * @returns {string}
      */
     function either(...args) {
@@ -1556,7 +1558,7 @@ var hljs = (function () {
       return mode;
     }
 
-    var version = "11.3.1";
+    var version = "11.4.0";
 
     class HTMLInjectionError extends Error {
       constructor(reason, html) {
@@ -2290,7 +2292,8 @@ var hljs = (function () {
         if (element.children.length > 0) {
           if (!options.ignoreUnescapedHTML) {
             console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious 
security risk.");
-            console.warn("https://github.com/highlightjs/highlight.js/issues/2886";);
+            console.warn("https://github.com/highlightjs/highlight.js/wiki/security";);
+            console.warn("The element with unescaped HTML:");
             console.warn(element);
           }
           if (options.throwUnescapedHTML) {
@@ -3705,10 +3708,14 @@ var hljs = (function () {
         regex.either(
           // Hard coded exceptions
           /\bJSON/,
-          // Float32Array
-          /\b[A-Z][a-z]+([A-Z][a-z]+|\d)*/,
-          // CSSFactory
-          /\b[A-Z]{2,}([A-Z][a-z]+|\d)+/,
+          // Float32Array, OutT
+          /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
+          // CSSFactory, CSSFactoryT
+          /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
+          // FPs, FPsT
+          /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/,
+          // P
+          // single letters are not highlighted
           // BLAH
           // this will be flagged as a UPPER_CASE_CONSTANT instead
         ),
@@ -3821,8 +3828,10 @@ var hljs = (function () {
           /const|var|let/, /\s+/,
           IDENT_RE$1, /\s*/,
           /=\s*/,
+          /(async\s*)?/, // async is optional
           regex.lookahead(FUNC_LEAD_IN_RE)
         ],
+        keywords: "async",
         className: {
           1: "keyword",
           3: "title.function"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]