Skip to content

Commit e9b724e

Browse files
committed
Add insert_marker method
Extracted from WordPress#6982
1 parent 724dde1 commit e9b724e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/wp-includes/html-api/class-wp-html-active-formatting-elements.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@ public function current_node() {
8686
return $current_node ? $current_node : null;
8787
}
8888

89+
/**
90+
* Inserts a "marker" at the end of the list of active formatting elements.
91+
*
92+
* > The markers are inserted when entering applet, object, marquee,
93+
* > template, td, th, and caption elements, and are used to prevent
94+
* > formatting from "leaking" into applet, object, marquee, template,
95+
* > td, th, and caption elements.
96+
*
97+
* @see https://html.spec.whatwg.org/#concept-parser-marker
98+
*
99+
* @since 6.7.0
100+
*/
101+
public function insert_marker() {
102+
$this->push( new WP_HTML_Token( null, 'marker', false ) );
103+
}
104+
89105
/**
90106
* Pushes a node onto the stack of active formatting elements.
91107
*

0 commit comments

Comments
 (0)