From 35a7333f7adc5972381926768299038774d467aa Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Nov 2020 07:43:29 -0500 Subject: [PATCH] fix(javascript) final solid fix for runaway regex --- src/languages/javascript.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 918a01c54a..2bccc2190c 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -256,9 +256,7 @@ export default function(hljs) { regex.lookahead(regex.concat( // we also need to allow for multiple possible comments inbetween // the first key:value pairing - /(\/\/.*$)*/, - /(\/\*(.|\n)*\*\/)*/, - /\s*/, + /(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/, IDENT_RE + '\\s*:'))), relevance: 0, contains: [