File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3021,19 +3021,19 @@ protected function compileComponents($value)
3021
3021
* @return string
3022
3022
*/
3023
3023
$ callback = function ($ match ) {
3024
- if (static ::contains ($ match [0 ], 'x- ' )) {
3024
+ if (isset ( $ match [ 4 ]) && static ::contains ($ match [0 ], 'x- ' )) {
3025
3025
$ match [4 ] = $ this ->compileComponents ($ match [4 ]);
3026
3026
}
3027
3027
$ paramsCompiled = $ this ->parseParams ($ match [2 ]);
3028
3028
$ str = "('components. " . $ match [1 ] . "', " . $ paramsCompiled . ") " ;
3029
- return self ::compileComponent ($ str ) . $ match [4 ] . self ::compileEndComponent ();
3029
+ return self ::compileComponent ($ str ) . ( $ match [4 ] ?? '' ) . self ::compileEndComponent ();
3030
3030
};
3031
3031
return preg_replace_callback ('/<x-([a-z0-9.-]+)(\s[^>]*)?(>((?:(?!<\/x-\1>).)*)<\/x-\1>|\/>)/ms ' , $ callback , $ value );
3032
3032
}
3033
3033
3034
3034
protected function parseParams ($ params ): string
3035
3035
{
3036
- preg_match_all ('/([a-z-0 -9:]*?)\s*?=\s*?(.+?)(\s|$)/ms ' , $ params , $ matches );
3036
+ preg_match_all ('/([a-zA-Z0 -9:- ]*?)\s*?=\s*?(.+?)(\s|$)/ms ' , $ params , $ matches );
3037
3037
$ paramsCompiled = [];
3038
3038
foreach ($ matches [1 ] as $ i => $ key ) {
3039
3039
$ value = str_replace ('" ' , '' , $ matches [2 ][$ i ]);
You can’t perform that action at this time.
0 commit comments