Skip to content

Commit f4373ff

Browse files
committed
Revert change to BR closing tag behavior.
1 parent fdf36bc commit f4373ff

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

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

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,25 +3200,19 @@ public function has_self_closing_flag(): bool {
32003200
* @return bool Whether the current tag is a tag closer.
32013201
*/
32023202
public function is_tag_closer(): bool {
3203-
if ( self::STATE_MATCHED_TAG !== $this->parser_state ) {
3204-
return false;
3205-
}
3206-
3207-
switch ( $this->get_namespace() ) {
3208-
case 'html':
3209-
/*
3210-
* The BR tag can only exist as an opening tag. If something like `</br>`
3211-
* appears then the HTML parser will treat it as an opening tag with no
3212-
* attributes. The BR tag is unique in this way.
3213-
*
3214-
* @see https://html.spec.whatwg.org/#parsing-main-inbody
3215-
*/
3216-
return $this->is_closing_tag && 'BR' !== $this->get_tag();
3203+
return (
3204+
self::STATE_MATCHED_TAG === $this->parser_state &&
3205+
$this->is_closing_tag &&
32173206

3218-
case 'math':
3219-
case 'svg':
3220-
return $this->is_closing_tag;
3221-
}
3207+
/*
3208+
* The BR tag can only exist as an opening tag. If something like `</br>`
3209+
* appears then the HTML parser will treat it as an opening tag with no
3210+
* attributes. The BR tag is unique in this way.
3211+
*
3212+
* @see https://html.spec.whatwg.org/#parsing-main-inbody
3213+
*/
3214+
'BR' !== $this->get_tag()
3215+
);
32223216
}
32233217

32243218
/**

0 commit comments

Comments
 (0)