fix
This commit is contained in:
parent
5987817f22
commit
c44b881e69
2 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,7 @@ name = "site_icons"
|
|||
version = "0.1.0"
|
||||
authors = ["Sam Denty <sam@samdenty.com>"]
|
||||
edition = "2018"
|
||||
license = "gpl-3.0"
|
||||
license = "GPL-3.0"
|
||||
homepage = "https://github.com/samdenty/site_icons"
|
||||
repository = "https://github.com/samdenty/site_icons"
|
||||
documentation = "https://docs.rs/site_icons"
|
||||
|
|
|
@ -28,6 +28,9 @@ pub fn encode_svg(svg: &str) -> String {
|
|||
svg.into()
|
||||
};
|
||||
|
||||
// use single quotes instead of double to avoid encoding.
|
||||
let encoded = regex!("\"").replace_all(&encoded, "'");
|
||||
|
||||
// remove whitespace
|
||||
let encoded = regex!(r">\s{1,}</g").replace_all(&encoded, "><");
|
||||
let encoded = regex!(r"\s{2,}").replace_all(&encoded, " ");
|
||||
|
|
Reference in a new issue