Skip to content

Commit 35a7333

Browse files
committed
fix(javascript) final solid fix for runaway regex
1 parent 6dba507 commit 35a7333

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/languages/javascript.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,7 @@ export default function(hljs) {
256256
regex.lookahead(regex.concat(
257257
// we also need to allow for multiple possible comments inbetween
258258
// the first key:value pairing
259-
/(\/\/.*$)*/,
260-
/(\/\*(.|\n)*\*\/)*/,
261-
/\s*/,
259+
/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,
262260
IDENT_RE + '\\s*:'))),
263261
relevance: 0,
264262
contains: [

0 commit comments

Comments
 (0)