mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
fix for issue #2500
This commit is contained in:
3
test/css/include-path-string/include-path-string.css
Normal file
3
test/css/include-path-string/include-path-string.css
Normal 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");
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
3
test/less/include-path-string/include-path-string.less
Normal file
3
test/less/include-path-string/include-path-string.less
Normal file
@@ -0,0 +1,3 @@
|
||||
data-uri {
|
||||
property: data-uri('image.svg');
|
||||
}
|
||||
Reference in New Issue
Block a user