diff --git a/lib/less/tree/import.js b/lib/less/tree/import.js index 4279852ed..a6c980e75 100644 --- a/lib/less/tree/import.js +++ b/lib/less/tree/import.js @@ -66,12 +66,8 @@ Import.prototype.genCSS = function (context, output) { } }; Import.prototype.getPath = function () { - if (this.path instanceof Quoted) { - return this.path.value; - } else if (this.path instanceof URL) { - return this.path.value.value; - } - return null; + return (this.path instanceof URL) ? + this.path.value.value : this.path.value; }; Import.prototype.isVariableImport = function () { var path = this.path; diff --git a/test/css/import.css b/test/css/import.css index f52f90823..51debe869 100644 --- a/test/css/import.css +++ b/test/css/import.css @@ -20,6 +20,9 @@ height: 10px; color: red; } +.test-f { + height: 10px; +} .deep-import-url { color: red; } diff --git a/test/less/import/import-test-a.less b/test/less/import/import-test-a.less index 1fa71c6ac..6916f17c6 100644 --- a/test/less/import/import-test-a.less +++ b/test/less/import/import-test-a.less @@ -1,4 +1,5 @@ @import "import-test-b.less"; +@import url(import-test-f.less); @import url("deeper/url-import.less"); @a: 20%; @import "urls.less"; \ No newline at end of file