mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Close #1777
Data-uri function used single quote ' around generated url, but did not encoded it in generated string. Switched it to " which is encoded.
This commit is contained in:
@@ -439,7 +439,7 @@ tree.functions = {
|
||||
buf = useBase64 ? buf.toString('base64')
|
||||
: encodeURIComponent(buf);
|
||||
|
||||
var uri = "'data:" + mimetype + ',' + buf + "'";
|
||||
var uri = "\"data:" + mimetype + ',' + buf + "\"";
|
||||
return new(tree.URL)(new(tree.Anonymous)(uri));
|
||||
},
|
||||
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
border-image: url('../data/image.jpg');
|
||||
}
|
||||
#data-uri {
|
||||
uri: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==');
|
||||
uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
|
||||
}
|
||||
#data-uri-guess {
|
||||
uri: url('data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==');
|
||||
uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==");
|
||||
}
|
||||
#data-uri-ascii {
|
||||
uri-1: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
|
||||
uri-2: url('data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A');
|
||||
uri-1: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
|
||||
uri-2: url("data:text/html,%3Ch1%3EThis%20page%20is%20100%25%20Awesome.%3C%2Fh1%3E%0A");
|
||||
}
|
||||
#data-uri-toobig {
|
||||
uri: url('../data/data-uri-fail.png');
|
||||
|
||||
Reference in New Issue
Block a user