Skip to content

Commit 3f353a8

Browse files
do not evaluate backticks in strings as inline-js
1 parent 257f615 commit 3f353a8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/less/tree/quoted.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var Quoted = function (str, content, escaped, index, currentFileInfo) {
1010
this._index = index;
1111
this._fileInfo = currentFileInfo;
1212
};
13-
Quoted.prototype = new JsEvalNode();
13+
Quoted.prototype = new Node();
1414
Quoted.prototype.type = "Quoted";
1515
Quoted.prototype.genCSS = function (context, output) {
1616
if (!this.escaped) {
@@ -22,13 +22,10 @@ Quoted.prototype.genCSS = function (context, output) {
2222
}
2323
};
2424
Quoted.prototype.containsVariables = function() {
25-
return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/);
25+
return this.value.match(/@\{([\w-]+)\}/);
2626
};
2727
Quoted.prototype.eval = function (context) {
2828
var that = this, value = this.value;
29-
var javascriptReplacement = function (_, exp) {
30-
return String(that.evaluateJavaScript(exp, context));
31-
};
3229
var variableReplacement = function (_, name) {
3330
var v = new Variable('@' + name, that.getIndex(), that.fileInfo()).eval(context, true);
3431
return (v instanceof Quoted) ? v.value : v.toCSS();
@@ -45,7 +42,6 @@ Quoted.prototype.eval = function (context) {
4542
} while (value !== evaluatedValue);
4643
return evaluatedValue;
4744
}
48-
value = iterativeReplace(value, /`([^`]+)`/g, javascriptReplacement);
4945
value = iterativeReplace(value, /@\{([\w-]+)\}/g, variableReplacement);
5046
value = iterativeReplace(value, /\$\{([\w-]+)\}/g, propertyReplacement);
5147
return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());

0 commit comments

Comments
 (0)