diff options
author | 2024-02-07 20:43:19 +0800 | |
---|---|---|
committer | 2024-02-07 20:43:19 +0800 | |
commit | 436841e97e0ecbf6e5e1658b2c1e272d7856cdc9 (patch) | |
tree | a8e1744f8fa4ce06420d72381a3659251e0ea9ae /packages/integrations/markdoc/src/html/css/parse-inline-styles.ts | |
parent | ce4283331f18c6178654dd705e3cf02efeef004a (diff) | |
download | astro-436841e97e0ecbf6e5e1658b2c1e272d7856cdc9.tar.gz astro-436841e97e0ecbf6e5e1658b2c1e272d7856cdc9.tar.zst astro-436841e97e0ecbf6e5e1658b2c1e272d7856cdc9.zip |
Use eslint-plugin-regexp (#9993)
Diffstat (limited to 'packages/integrations/markdoc/src/html/css/parse-inline-styles.ts')
-rw-r--r-- | packages/integrations/markdoc/src/html/css/parse-inline-styles.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/integrations/markdoc/src/html/css/parse-inline-styles.ts b/packages/integrations/markdoc/src/html/css/parse-inline-styles.ts index 623b560af..fa3217c89 100644 --- a/packages/integrations/markdoc/src/html/css/parse-inline-styles.ts +++ b/packages/integrations/markdoc/src/html/css/parse-inline-styles.ts @@ -23,9 +23,11 @@ const NEWLINE_REGEX = /\n/g; const WHITESPACE_REGEX = /^\s*/; // declaration -const PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; +const PROPERTY_REGEX = /^([-#/*\\\w]+(\[[\da-z_-]+\])?)\s*/; const COLON_REGEX = /^:\s*/; -const VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; +// Disable eslint as we're not sure how to improve this regex yet +// eslint-disable-next-line regexp/no-super-linear-backtracking +const VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*\)|[^};])+)/; const SEMICOLON_REGEX = /^[;\s]*/; // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill |