aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-04-29 16:26:01 +1000
committerYuchen Pei <hi@ypei.me>2022-04-29 17:01:40 +1000
commit3dafc83753fbabc8d80540e05cf1e374ae73f4fa (patch)
treee1ca66c6573cac9760f6ebd159c8643ed151910d
parent14d68d150afd90a74a710475e723d7d9917ec780 (diff)
Fixing license-end detection to accept /* */ comment
Previously only // @license-end was accepted.
-rw-r--r--main_background.js3
1 files changed, 2 insertions, 1 deletions
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];