Fixed css replacement with more than one linked asset

This commit is contained in:
Emi Simpson 2019-12-06 13:52:51 -05:00
parent 7412d663e0
commit 4decea716c
No known key found for this signature in database
GPG key ID: 68FAB2E2E6DFC98B

View file

@ -145,8 +145,10 @@ pub fn resolve_css_imports(
let replacement = format!("\"{}\"", &content);
let dest = link.name("to_repl").unwrap();
let offset = resolved_css.len() - css_string.len();
let target_range = (dest.start() + offset)..(dest.end() + offset);
resolved_css.replace_range(dest.start()..dest.end(), &replacement);
resolved_css.replace_range(target_range, &replacement);
}
if as_dataurl {