lib/less/js/lib/less/tree/quoted.js in less-2.4.0 vs lib/less/js/lib/less/tree/quoted.js in less-2.5.0
- old
+ new
@@ -7,25 +7,28 @@
this.index = index;
this.currentFileInfo = currentFileInfo;
};
tree.Quoted.prototype = {
type: "Quoted",
- toCSS: function () {
- if (this.escaped) {
- return this.value;
- } else {
- return this.quote + this.value + this.quote;
+ genCSS: function (env, output) {
+ if (!this.escaped) {
+ output.add(this.quote, this.currentFileInfo, this.index);
}
+ output.add(this.value);
+ if (!this.escaped) {
+ output.add(this.quote);
+ }
},
+ toCSS: tree.toCSS,
eval: function (env) {
var that = this;
var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
}).replace(/@\{([\w-]+)\}/g, function (_, name) {
var v = new(tree.Variable)('@' + name, that.index, that.currentFileInfo).eval(env, true);
return (v instanceof tree.Quoted) ? v.value : v.toCSS();
});
- return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
+ return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index, this.currentFileInfo);
},
compare: function (x) {
if (!x.toCSS) {
return -1;
}