Prevent crash on URLs delimited by single quotes
This commit is contained in:
parent
7412d663e0
commit
90e6cb1c45
1 changed files with 1 additions and 1 deletions
|
@ -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>@import )?url\((?P<to_repl>"?(?P<url>[^"]+)"?)\)"###).unwrap();
|
||||
Regex::new(r###"(?P<import>@import )?url\((?P<to_repl>['"]?(?P<url>[^"'\)]+)['"]?)\)"###).unwrap();
|
||||
|
||||
for link in re.captures_iter(&css_string) {
|
||||
let target_link = link.name("url").unwrap().as_str();
|
||||
|
|
Loading…
Add table
Reference in a new issue