@@ -86,10 +86,6 @@ protected static function pushToken(Context $context, array|string $token)
86
86
}
87
87
if (is_string ($ token )) {
88
88
static ::pushPartial ($ context , $ token );
89
- if (is_string (end ($ context ->parsed [0 ]))) {
90
- $ context ->parsed [0 ][key ($ context ->parsed [0 ])] .= $ token ;
91
- return ;
92
- }
93
89
} else {
94
90
static ::pushPartial ($ context , Token::toString ($ context ->currentToken ));
95
91
switch ($ context ->currentToken [Token::POS_OP ]) {
@@ -466,8 +462,6 @@ protected static function rawblock(array &$token, Context $context): bool
466
462
return true ;
467
463
}
468
464
469
- $ token [Token::POS_INNERTAG ] = $ inner ;
470
-
471
465
// Handle raw block
472
466
if ($ token [Token::POS_BEGINRAW ] === '{{ ' ) {
473
467
if ($ token [Token::POS_ENDRAW ] !== '}} ' ) {
@@ -480,9 +474,10 @@ protected static function rawblock(array &$token, Context $context): bool
480
474
if ($ token [Token::POS_OP ]) {
481
475
$ context ->error [] = "Wrong raw block begin with " . Token::toString ($ token ) . ' ! Remove " ' . $ token [Token::POS_OP ] . '" to fix this issue. ' ;
482
476
}
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 ];
484
479
Token::setDelimiter ($ context );
485
- $ token [Token::POS_OP ] = '# ' ;
480
+ $ token [Token::POS_OP ] = '# ' ; // parse as custom block
486
481
}
487
482
$ token [Token::POS_ENDRAW ] = '}} ' ;
488
483
}
0 commit comments