fix for issue #2500

This commit is contained in:
Bass Jobsen
2015-03-15 23:09:50 +01:00
parent c4fa45f3b9
commit 4bb098bfc9
5 changed files with 14 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
data-uri {
property: url("data:image/svg+xml,%3Csvg%20height%3D%22100%22%20width%3D%22100%22%3E%0A%20%20%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2240%22%20stroke%3D%22black%22%20stroke-width%3D%221%22%20fill%3D%22blue%22%20%2F%3E%0A%3C%2Fsvg%3E");
}

View File

@@ -47,6 +47,7 @@ lessTester.runTestSet({modifyVars: true}, "modifyVars/",
null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; });
lessTester.runTestSet({urlArgs: '424242'}, "url-args/");
lessTester.runTestSet({paths: ['test/data/', 'test/less/import/']}, "include-path/");
lessTester.runTestSet({paths: 'test/data/'}, "include-path-string/");
lessTester.testSyncronous({syncImport: true}, "import");
lessTester.testSyncronous({syncImport: true}, "css");
lessTester.testNoOptions();

View File

@@ -331,10 +331,11 @@ module.exports = function() {
function toCSS(options, path, callback) {
options = options || {};
var str = fs.readFileSync(path, 'utf8'), addPath = require('path').dirname(path);
options.paths = options.paths || [];
if (!contains(options.paths, addPath)) {
options.paths.push(addPath);
if (typeof options.paths !== "string") {
options.paths = options.paths || [];
if (!contains(options.paths, addPath)) {
options.paths.push(addPath);
}
}
options.filename = require('path').resolve(process.cwd(), path);
options.optimization = options.optimization || 0;

View File

@@ -0,0 +1,3 @@
data-uri {
property: data-uri('image.svg');
}