@@ -86,10 +86,6 @@ protected static function pushToken(Context $context, array|string $token)
8686 }
8787 if (is_string ($ token )) {
8888 static ::pushPartial ($ context , $ token );
89- if (is_string (end ($ context ->parsed [0 ]))) {
90- $ context ->parsed [0 ][key ($ context ->parsed [0 ])] .= $ token ;
91- return ;
92- }
9389 } else {
9490 static ::pushPartial ($ context , Token::toString ($ context ->currentToken ));
9591 switch ($ context ->currentToken [Token::POS_OP ]) {
@@ -466,8 +462,6 @@ protected static function rawblock(array &$token, Context $context): bool
466462 return true ;
467463 }
468464
469- $ token [Token::POS_INNERTAG ] = $ inner ;
470-
471465 // Handle raw block
472466 if ($ token [Token::POS_BEGINRAW ] === '{{ ' ) {
473467 if ($ token [Token::POS_ENDRAW ] !== '}} ' ) {
@@ -480,9 +474,10 @@ protected static function rawblock(array &$token, Context $context): bool
480474 if ($ token [Token::POS_OP ]) {
481475 $ context ->error [] = "Wrong raw block begin with " . Token::toString ($ token ) . ' ! Remove " ' . $ token [Token::POS_OP ] . '" to fix this issue. ' ;
482476 }
483- $ context ->rawBlock = $ token [Token::POS_INNERTAG ];
477+ // store name (before arguments) in order to find the block end
478+ $ context ->rawBlock = preg_split ('/\s+/ ' , $ token [Token::POS_INNERTAG ], 2 )[0 ];
484479 Token::setDelimiter ($ context );
485- $ token [Token::POS_OP ] = '# ' ;
480+ $ token [Token::POS_OP ] = '# ' ; // parse as custom block
486481 }
487482 $ token [Token::POS_ENDRAW ] = '}} ' ;
488483 }
0 commit comments