Skip to content

Commit 9bf0448

Browse files
committed
HTML API: Fix logic bug in HTML Processor when opening A element.
A mistake in the original code handling opening A elements in the HTML Processor led to mistakes in parsing where the Processor would bail in situations when it could have proceeded. While this was errant behavior, it didn't violate the public contract since it would bail in these situations. This patch fixes the mistake, which was to only break out of the innermost loop instead of breaking from the containing loop, which resolves the issue. Developed in #7281 Discussed in https://core.trac.wordpress.org/ticket/61576 Follow-up to [56274]. Props jonsurrell. See #61576. git-svn-id: https://develop.svn.wordpress.org/trunk@58966 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 59e07af commit 9bf0448

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,13 +2352,13 @@ private function step_in_body(): bool {
23522352
foreach ( $this->state->active_formatting_elements->walk_up() as $item ) {
23532353
switch ( $item->node_name ) {
23542354
case 'marker':
2355-
break;
2355+
break 2;
23562356

23572357
case 'A':
23582358
$this->run_adoption_agency_algorithm();
23592359
$this->state->active_formatting_elements->remove_node( $item );
23602360
$this->state->stack_of_open_elements->remove_node( $item );
2361-
break;
2361+
break 2;
23622362
}
23632363
}
23642364

0 commit comments

Comments
 (0)