mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Allow multiline javascript expressions, fixes #885
This commit is contained in:
@@ -284,7 +284,7 @@ less.Parser = function Parser(env) {
|
||||
var j = 0,
|
||||
skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
|
||||
comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
|
||||
string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`\\\r\n]|\\.)*)`/g,
|
||||
string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
|
||||
level = 0,
|
||||
match,
|
||||
chunk = chunks[0],
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
js: 1, 2, 3;
|
||||
title: "string";
|
||||
ternary: true;
|
||||
multiline: 2;
|
||||
}
|
||||
.scope {
|
||||
var: 42;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
js: `[1, 2, 3]`;
|
||||
title: `typeof process.title`;
|
||||
ternary: `(1 + 1 == 2 ? true : false)`;
|
||||
multiline: `(function(){var x = 1 + 1;
|
||||
return x})()`;
|
||||
}
|
||||
.scope {
|
||||
@foo: 42;
|
||||
|
||||
Reference in New Issue
Block a user