Skip to content

Commit

Permalink
do not evaluate backticks in strings as inline-js
Browse files Browse the repository at this point in the history
  • Loading branch information
seven-phases-max committed Jun 8, 2017
1 parent 257f615 commit 4483517
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/less/tree/quoted.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var Quoted = function (str, content, escaped, index, currentFileInfo) {
this._index = index;
this._fileInfo = currentFileInfo;
};
Quoted.prototype = new JsEvalNode();
Quoted.prototype = new Node();
Quoted.prototype.type = "Quoted";
Quoted.prototype.genCSS = function (context, output) {
if (!this.escaped) {
Expand All @@ -22,7 +22,7 @@ Quoted.prototype.genCSS = function (context, output) {
}
};
Quoted.prototype.containsVariables = function() {
return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/);
return this.value.match(/@\{([\w-]+)\}/);
};
Quoted.prototype.eval = function (context) {
var that = this, value = this.value;
Expand All @@ -45,7 +45,6 @@ Quoted.prototype.eval = function (context) {
} while (value !== evaluatedValue);
return evaluatedValue;
}
value = iterativeReplace(value, /`([^`]+)`/g, javascriptReplacement);
value = iterativeReplace(value, /@\{([\w-]+)\}/g, variableReplacement);
value = iterativeReplace(value, /\$\{([\w-]+)\}/g, propertyReplacement);
return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());
Expand Down

0 comments on commit 4483517

Please sign in to comment.