File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1414,15 +1414,28 @@ public function serialize_token(): string {
14141414 }
14151415
14161416 $ html .= "< {$ qualified_name }" ;
1417+
1418+ $ previous_attribute_was_true = false ;
14171419 foreach ( $ attribute_names as $ attribute_name ) {
1418- $ html .= " {$ this ->get_qualified_attribute_name ( $ attribute_name )}" ;
1420+ $ qualified_attribute_name = $ this ->get_qualified_attribute_name ( $ attribute_name );
1421+
1422+ if (
1423+ $ previous_attribute_was_true &&
1424+ isset ( $ qualified_attribute_name [0 ] ) &&
1425+ '= ' === $ qualified_attribute_name [0 ]
1426+ ) {
1427+ $ html .= '="" ' ;
1428+ }
1429+
1430+ $ html .= " {$ qualified_attribute_name }" ;
14191431 $ value = $ this ->get_attribute ( $ attribute_name );
14201432
14211433 if ( is_string ( $ value ) ) {
14221434 $ html .= '=" ' . htmlspecialchars ( $ value , ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5 ) . '" ' ;
14231435 }
14241436
1425- $ html = str_replace ( "\x00" , "\u{FFFD}" , $ html );
1437+ $ previous_attribute_was_true = true === $ value ;
1438+ $ html = str_replace ( "\x00" , "\u{FFFD}" , $ html );
14261439 }
14271440
14281441 if ( ! $ in_html && $ this ->has_self_closing_flag () ) {
You can’t perform that action at this time.
0 commit comments