Skip to content

Commit 95e5fcf

Browse files
committed
Update url directive to support double or single quotes
1 parent 11393ce commit 95e5fcf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/transformers/inline_url.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ fn read_file_sync(path: &Path) -> Option<Vec<u8>> {
4141

4242
fn parse_url(input: &str) -> nom::IResult<&str, &str> {
4343
let unquoted = delimited(tag("url("), is_not(")"), tag(")"));
44-
let quoted = delimited(tag("url(\""), is_not("\""), tag("\")"));
45-
alt((quoted, unquoted))(input)
44+
let dblquoted = delimited(tag("url(\""), is_not("\""), tag("\")"));
45+
let sglquoted = delimited(tag("url('"), is_not("'"), tag("')"));
46+
alt((sglquoted, dblquoted, unquoted))(input)
4647
}
4748

4849
fn into_data_uri<'a>(path: &Path) -> Option<Cow<'a, str>> {

0 commit comments

Comments
 (0)