From 44835175ad77427a267c29db95ddbf6b8a0d02df Mon Sep 17 00:00:00 2001 From: Max Mikhailov Date: Thu, 8 Jun 2017 09:41:50 +0300 Subject: [PATCH] do not evaluate backticks in strings as inline-js --- lib/less/tree/quoted.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/less/tree/quoted.js b/lib/less/tree/quoted.js index 33fa3033d..b4802ecb2 100644 --- a/lib/less/tree/quoted.js +++ b/lib/less/tree/quoted.js @@ -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) { @@ -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; @@ -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());