mirror of
https://github.com/less/less.js.git
synced 2026-02-08 22:15:04 -05:00
@@ -20,14 +20,21 @@ tree.Quoted.prototype = {
|
||||
},
|
||||
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, this.currentFileInfo);
|
||||
var that = this;
|
||||
var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
|
||||
return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
|
||||
});
|
||||
var evaluatedValue = value;
|
||||
var interpolationReplacementFnc = function (_, name) {
|
||||
var v = new(tree.Variable)('@' + name, that.index, that.currentFileInfo).eval(env, true);
|
||||
return (v instanceof tree.Quoted) ? v.value : v.toCSS();
|
||||
};
|
||||
do {
|
||||
value = evaluatedValue;
|
||||
evaluatedValue = value.replace(/@\{([\w-]+)\}/g, interpolationReplacementFnc);
|
||||
} while (value!==evaluatedValue);
|
||||
value = evaluatedValue;
|
||||
return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index, this.currentFileInfo);
|
||||
},
|
||||
compare: function (x) {
|
||||
if (!x.toCSS) {
|
||||
|
||||
Reference in New Issue
Block a user