From 3dafc83753fbabc8d80540e05cf1e374ae73f4fa Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 29 Apr 2022 16:26:01 +1000 Subject: Fixing license-end detection to accept /* */ comment Previously only // @license-end was accepted. --- main_background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main_background.js b/main_background.js index d3d7bb4..df5be8e 100644 --- a/main_background.js +++ b/main_background.js @@ -651,7 +651,8 @@ function license_read(scriptSrc, name, external = false) { // let's check the actual license uneditedSrc = uneditedSrc.substring(openingIndex); - const closureMatch = /\/([*/])\s*@license-end\b[^*/\n]*/i.exec(uneditedSrc); + const closureMatch = + /\/([*/])\s*@license-end\s*(\*\/)?/mi.exec(uneditedSrc); if (!closureMatch) { const msg = 'ERROR: @license with no @license-end'; return [false, `\n/*\n ${msg} \n*/\n`, msg]; -- cgit v1.2.3