less 3.10.2 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lessc +9 -5
- package/dist/less.cjs.js +9 -5
- package/dist/less.js +10 -6
- package/dist/less.min.js +2 -2
- package/dist/less.min.js.map +1 -1
- package/lib/less/functions/list.js +2 -1
- package/lib/less/functions/string.js +1 -2
- package/lib/less/index.js +1 -1
- package/lib/less/parser/parser.js +4 -2
- package/lib/less/tree/quoted.js +3 -0
- package/package.json +1 -1
- package/test/browser/less.min.js +2 -2
- package/test/browser/less.min.js.map +1 -1
- package/test/css/css-escapes.css +1 -0
- package/test/less/css-escapes.less +3 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import Quoted from '../tree/quoted';
|
|
2
2
|
import Anonymous from '../tree/anonymous';
|
|
3
|
-
import Quote from '../tree/quoted';
|
|
4
3
|
import JavaScript from '../tree/javascript';
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
e: function (str) {
|
|
8
|
-
return new
|
|
7
|
+
return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true);
|
|
9
8
|
},
|
|
10
9
|
escape: function (str) {
|
|
11
10
|
return new Anonymous(
|
package/lib/less/index.js
CHANGED
|
@@ -107,8 +107,10 @@ const Parser = function Parser(context, imports, fileInfo) {
|
|
|
107
107
|
i = parser.i;
|
|
108
108
|
result = parsers[p]();
|
|
109
109
|
if (result) {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
try {
|
|
111
|
+
result._index = i + currentIndex;
|
|
112
|
+
result._fileInfo = fileInfo;
|
|
113
|
+
} catch (e) {}
|
|
112
114
|
returnNodes.push(result);
|
|
113
115
|
}
|
|
114
116
|
else {
|
package/lib/less/tree/quoted.js
CHANGED
|
@@ -2,6 +2,7 @@ import Node from './node';
|
|
|
2
2
|
import Variable from './variable';
|
|
3
3
|
import Property from './property';
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
class Quoted extends Node {
|
|
6
7
|
constructor(str, content, escaped, index, currentFileInfo) {
|
|
7
8
|
super();
|
|
@@ -13,6 +14,7 @@ class Quoted extends Node {
|
|
|
13
14
|
this._fileInfo = currentFileInfo;
|
|
14
15
|
this.variableRegex = /@\{([\w-]+)\}/g;
|
|
15
16
|
this.propRegex = /\$\{([\w-]+)\}/g;
|
|
17
|
+
this.allowRoot = escaped;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
genCSS(context, output) {
|
|
@@ -50,6 +52,7 @@ class Quoted extends Node {
|
|
|
50
52
|
}
|
|
51
53
|
value = iterativeReplace(value, this.variableRegex, variableReplacement);
|
|
52
54
|
value = iterativeReplace(value, this.propRegex, propertyReplacement);
|
|
55
|
+
|
|
53
56
|
return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());
|
|
54
57
|
}
|
|
55
58
|
|