diff --git a/lib/inline-images.js b/lib/inline-images.js index faab90c..93a3488 100644 --- a/lib/inline-images.js +++ b/lib/inline-images.js @@ -12,15 +12,15 @@ module.exports = function(less) { run: function (root) { return this._visitor.visit(root); }, - visitRule: function (ruleNode, visitArgs) { - this._inRule = true; - return ruleNode; + visitDeclaration: function (declarationNode, visitArgs) { + this._inDeclaration = true; + return declarationNode; }, - visitRuleOut: function (ruleNode, visitArgs) { - this._inRule = false; + visitDeclarationOut: function (declarationNode, visitArgs) { + this._inDeclaration = false; }, visitUrl: function (URLNode, visitArgs) { - if (!this._inRule) { + if (!this._inDeclaration) { return URLNode; } if (URLNode.value && URLNode.value.value && URLNode.value.value.indexOf('#') === 0) { @@ -28,7 +28,7 @@ module.exports = function(less) { // ``behavior:url(#default#VML);`` return URLNode; } - return new less.tree.Call("data-uri", [new ParamStringReplacementNode(URLNode.value)], URLNode.index || 0, URLNode.currentFileInfo); + return new less.tree.Call("data-uri", [new ParamStringReplacementNode(URLNode.value)], URLNode.index || 0, URLNode.fileInfo()); } }; return InlineImages;