From 33df061b5307816c658bba3c99e258b968aeb645 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Tue, 20 Nov 2018 17:06:20 -0600 Subject: [PATCH] Allow /*! in UserCSS metadata. Closes #571 --- edit/linter-meta.js | 2 +- js/usercss.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edit/linter-meta.js b/edit/linter-meta.js index d99282ee..bd146a52 100644 --- a/edit/linter-meta.js +++ b/edit/linter-meta.js @@ -12,7 +12,7 @@ function createMetaCompiler(cm) { if (_cm !== cm) { return; } - const match = text.match(/\/\*\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i); + const match = text.match(/\/\*\!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i); if (!match) { return []; } diff --git a/js/usercss.js b/js/usercss.js index 0e9b95a5..27bc9c92 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -10,7 +10,7 @@ const usercss = (() => { // updateURL: 'updateUrl', name: undefined, }; - const RX_META = /\/\*\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i; + const RX_META = /\/\*\!?\s*==userstyle==[\s\S]*?==\/userstyle==\s*\*\//i; const ERR_ARGS_IS_LIST = new Set(['missingMandatory', 'missingChar']); return {buildMeta, buildCode, assignVars};