From 3343d1cf8735a0b074007c81a749f87d8cd45087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 20 Feb 2023 14:30:45 +0100 Subject: [PATCH] #747: improve regex to recognize edge cases --- lib/util/util.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/util/util.js b/lib/util/util.js index c5bceb130..bd4aef6cf 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -609,7 +609,12 @@ const Util = { if (!code) { return null; } - const scriptRegex = /^ + const scriptRegex = /^<\s*script [^>]*?>(.*)<\/\s*script\s*>$/ms; code = code.trim(); const regexMatches = scriptRegex.exec(code); if (regexMatches?.length > 1) {