From 90e6cb1c45f6dca9d19cfc34f948a2aee2bf55bf Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Fri, 6 Dec 2019 11:52:31 -0500 Subject: [PATCH] Prevent crash on URLs delimited by single quotes --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index f794317..f8f6502 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -89,7 +89,7 @@ pub fn resolve_css_imports( ) -> String { let mut resolved_css = String::from(css_string); let re = - Regex::new(r###"(?P@import )?url\((?P"?(?P[^"]+)"?)\)"###).unwrap(); + Regex::new(r###"(?P@import )?url\((?P['"]?(?P[^"'\)]+)['"]?)\)"###).unwrap(); for link in re.captures_iter(&css_string) { let target_link = link.name("url").unwrap().as_str();