diff --git a/lib/Less/Tree/Quoted.php b/lib/Less/Tree/Quoted.php index 2b67e868..b78b85e5 100644 --- a/lib/Less/Tree/Quoted.php +++ b/lib/Less/Tree/Quoted.php @@ -45,17 +45,20 @@ public function compile( $env ) { $value = str_replace( $matches[0][$i], $js, $value ); } } - - if ( preg_match_all( '/@\{([\w-]+)\}/', $value, $matches ) ) { - foreach ( $matches[1] as $i => $match ) { - $v = new Less_Tree_Variable( '@' . $match, $this->index, $this->currentFileInfo ); - $v = $v->compile( $env ); - $v = ( $v instanceof self ) ? $v->value : $v->toCSS(); - $value = str_replace( $matches[0][$i], $v, $value ); + $r = $value; + do{ + $value = $r; + if ( preg_match_all( '/@\{([\w-]+)\}/', $value, $matches ) ) { + foreach ( $matches[1] as $i => $match ) { + $v = new Less_Tree_Variable( '@' . $match, $this->index, $this->currentFileInfo ); + $v = $v->compile( $env ); + $v = ( $v instanceof self ) ? $v->value : $v->toCSS(); + $r = str_replace( $matches[0][$i], $v, $r ); + } } - } + }while ( $r != $value ); - return new self( $this->quote . $value . $this->quote, $value, $this->escaped, $this->index, $this->currentFileInfo ); + return new self( $this->quote . $r . $this->quote, $r, $this->escaped, $this->index, $this->currentFileInfo ); } public function compare( $x ) { diff --git a/lib/Less/Tree/Selector.php b/lib/Less/Tree/Selector.php index d1307a56..64390542 100644 --- a/lib/Less/Tree/Selector.php +++ b/lib/Less/Tree/Selector.php @@ -101,14 +101,13 @@ public function CacheElements() { $css .= $v->value; continue; } - - if ( - ( $v->value instanceof Less_Tree_Selector || $v->value instanceof Less_Tree_Variable ) + if ( ( $v->value instanceof Less_Tree_Selector || $v->value instanceof Less_Tree_Variable ) || !is_string( $v->value->value ) ) { $this->cacheable = false; - return; } - $css .= $v->value->value; + if ( isset( $v->value->value ) && !is_object( $v->value->value ) ) { + $css .= $v->value->value; + } } $this->_oelements_len = preg_match_all( '/[,&#\*\.\w-](?:[\w-]|(?:\\\\.))*/', $css, $matches ); diff --git a/test/phpunit/FixturesTest.php b/test/phpunit/FixturesTest.php index 93375c3b..aff8e049 100644 --- a/test/phpunit/FixturesTest.php +++ b/test/phpunit/FixturesTest.php @@ -41,8 +41,7 @@ class phpunit_FixturesTest extends phpunit_bootstrap { 'css-3' => true, 'import-reference' => true, - // Temporary disabled; Bug logged T353133 - 'strings' => true, + // TODO; Create Task for import-interpolation 'import-interpolation' => true, // Temporary disabled; Bug logged here T352897 @@ -73,8 +72,6 @@ class phpunit_FixturesTest extends phpunit_bootstrap { // behaviour of doing maths in parentheses by default 'parens' => true, - // Temporary disabled; Bug logged T353142 - 'mixins-interpolated' => true, // Temporary disabled; Bug logged T353143 'detached-rulesets' => true, ]