Skip to content

Commit a82adb5

Browse files
committed
fix interpolation bug when using ~ escape operator
1 parent 5d2e95a commit a82adb5

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

lessc.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ function value(&$value) {
520520

521521
// unquote string
522522
if ($this->literal("~") && $this->string($value, $d)) {
523-
$value = array("keyword", $value);
523+
$value = array("escape", $value);
524524
return true;
525525
} else {
526526
$this->seek($s);
@@ -1379,6 +1379,7 @@ function compileValue($value) {
13791379
case 'number':
13801380
// [1] - the number
13811381
return $value[1];
1382+
case 'escape':
13821383
case 'string':
13831384
// [1] - contents of string (includes quotes)
13841385

tests/inputs/escape.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ body {
1212
line-height: ~"eating rice";
1313
line-height: ~"string cheese";
1414
line-height: a b c ~"string me" d e f;
15+
line-height: ~"string @{hello}";
1516
}
1617

1718
.class {

tests/outputs/escape.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ body {
99
line-height:eating rice;
1010
line-height:string cheese;
1111
line-height:a b c string me d e f;
12+
line-height:string world;
1213
}
1314
.class { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png'); }

0 commit comments

Comments
 (0)