From 743c4a2a1d551e4467c9ea6919f8750913d9c52c Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 12 Nov 2020 06:41:49 -0500 Subject: [PATCH] fix(livescript) fix potential catastrophic backtracking --- src/languages/livescript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/livescript.js b/src/languages/livescript.js index c8e9f81301..6d5f4abf15 100644 --- a/src/languages/livescript.js +++ b/src/languages/livescript.js @@ -115,7 +115,7 @@ export default function(hljs) { { // regex can't start with space to parse x / 2 / 3 as two divisions // regex can't start with *, and it supports an "illegal" in the main mode - begin: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W)/ + begin: /\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/ } ] },