File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -453,11 +453,18 @@ private function spawn_fragment_parser( string $html ): ?self {
453
453
$ fragment_processor = self ::create_fragment ( $ html );
454
454
$ fragment_processor ->compat_mode = $ this ->compat_mode ;
455
455
456
- // @todo The context element probably needs a namespace{
457
456
$ context_element = array ( $ this ->get_tag (), array () );
458
457
foreach ( $ this ->get_attribute_names_with_prefix ( '' ) as $ name => $ value ) {
459
458
$ context_element [1 ][ $ name ] = $ value ;
460
459
}
460
+
461
+ $ fragment_processor ->context_node = new WP_HTML_Token (
462
+ 'context-node ' ,
463
+ $ context_element [0 ],
464
+ $ this ->has_self_closing_flag ()
465
+ );
466
+ $ fragment_processor ->context_node ->namespace = $ this ->get_namespace ();
467
+
461
468
$ fragment_processor ->state ->context_node = $ context_element ;
462
469
463
470
if ( 'TEMPLATE ' === $ context_element [0 ] ) {
You can’t perform that action at this time.
0 commit comments