diff options
author | Yuchen Pei <hi@ypei.me> | 2022-04-29 16:26:01 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-04-29 17:01:40 +1000 |
commit | 3dafc83753fbabc8d80540e05cf1e374ae73f4fa (patch) | |
tree | e1ca66c6573cac9760f6ebd159c8643ed151910d | |
parent | 14d68d150afd90a74a710475e723d7d9917ec780 (diff) |
Fixing license-end detection to accept /* */ comment
Previously only
// @license-end
was accepted.
-rw-r--r-- | main_background.js | 3 |
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]; |