Changeset 58712
- Timestamp:
- 07/12/2024 09:58:20 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
r58281 r58712 41 41 'tests1/line0342' => "Closing P tag implicitly creates opener, which we don't visit.", 42 42 'tests1/line0720' => 'Unimplemented: Reconstruction of active formatting elements.', 43 'tests1/line0833' => 'Bug.',44 43 'tests15/line0001' => 'Unimplemented: Reconstruction of active formatting elements.', 45 44 'tests15/line0022' => 'Unimplemented: Reconstruction of active formatting elements.', … … 52 51 'tests25/line0169' => 'Bug.', 53 52 'tests26/line0263' => 'Bug: An active formatting element should be created for a trailing text node.', 54 'tests7/line0354' => 'Bug.',55 'tests8/line0001' => 'Bug.',56 'tests8/line0020' => 'Bug.',57 'tests8/line0037' => 'Bug.',58 'tests8/line0052' => 'Bug.',59 'webkit01/line0174' => 'Bug.',60 53 ); 61 62 54 63 55 /** … … 161 153 $indent_level = 2; 162 154 $indent = ' '; 155 $was_text = null; 156 $text_node = ''; 163 157 164 158 while ( $processor->next_token() ) { 165 159 if ( ! is_null( $processor->get_last_error() ) ) { 166 160 return null; 161 } 162 163 if ( $was_text && '#text' !== $processor->get_token_name() ) { 164 $output .= "{$text_node}\"\n"; 165 $was_text = false; 166 $text_node = ''; 167 167 } 168 168 … … 199 199 $output .= str_repeat( $indent, $tag_indent + 1 ) . "{$attribute_name}=\"{$val}\"\n"; 200 200 } 201 202 // Self-contained tags contain their inner contents as modifiable text. 203 $modifiable_text = $processor->get_modifiable_text(); 204 if ( '' !== $modifiable_text ) { 205 $was_text = true; 206 if ( '' === $text_node ) { 207 $text_node = str_repeat( $indent, $indent_level ) . '"'; 208 } 209 $text_node .= $modifiable_text; 210 --$indent_level; 211 } 201 212 } 202 213 … … 204 215 205 216 case '#text': 206 $output .= str_repeat( $indent, $indent_level ) . "\"{$processor->get_modifiable_text()}\"\n"; 217 $was_text = true; 218 if ( '' === $text_node ) { 219 $text_node .= str_repeat( $indent, $indent_level ) . '"'; 220 } 221 $text_node .= $processor->get_modifiable_text(); 207 222 break; 208 223 … … 237 252 if ( $processor->paused_at_incomplete_token() ) { 238 253 return null; 254 } 255 256 if ( '' !== $text_node ) { 257 $output .= "${text_node}\"\n"; 239 258 } 240 259
Note: See TracChangeset
for help on using the changeset viewer.