From c85c52ba3f9bb05c44d3b54752d7d9b1c8ad3fa5 Mon Sep 17 00:00:00 2001 From: Peter Hagen Date: Fri, 11 Mar 2022 21:32:13 +0100 Subject: [PATCH] Fix url() parsing without quotes https://github.com/reworkcss/css/pull/110 --- lib/parse/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/parse/index.js b/lib/parse/index.js index f34e7ec7..99ecada8 100644 --- a/lib/parse/index.js +++ b/lib/parse/index.js @@ -223,8 +223,8 @@ module.exports = function(css, options){ // : if (!match(/^:\s*/)) return error("property missing ':'"); - // val - var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?['"]\)|[^};])+)/); + // Quotes regex repeats verbatim inside and outside parentheses + var val = match(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/); var ret = pos({ type: 'declaration',