Skip to content

Commit e1f156b

Browse files
authored
Merge pull request #20 from ProspectiveCo/svg-inline-support
Add `svg` inline support
2 parents ea5be4c + fdca500 commit e1f156b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/transformers/inline_url.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ fn into_data_uri<'a>(path: &Path) -> Option<Cow<'a, str>> {
5252
let contents = read_file_sync(path)?;
5353
let encoded = base64::encode(contents);
5454
let fff = path.extension().unwrap_or_default().to_string_lossy();
55+
let ggg = path.to_string_lossy();
5556
let fmt = match fff.as_ref() {
5657
"png" => "png",
57-
_ => "svg+xml",
58+
"gif" => "gif",
59+
"svg" => "svg+xml",
60+
x => ggg.as_ref(),
5861
};
5962

6063
Some(format!("url(\"data:image/{};base64,{}\")", fmt, encoded).into())

0 commit comments

Comments
 (0)