mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-03 09:21:03 +01:00
ec7c61e320
This patch adds a new method, `WP_HTML_Processor->expects_closer()` to indicate if the currently-matched node expects to find a closing token. For example, a `DIV` element expects a closing `</div>` tag, but an `<img>` expects none, because it's a void element. Similarly, `#text` nodes and HTML comments only appear as unitary nodes on the stack of open elements. Once proceeding further in the document they are immediately removed without any closing tag. This new method serves as a helper to indicate whether or not to expect the closer, as this can be more complicated than it seems, and calling code shouldn't have to build custom interpretations and implementations. Instead, the HTML Processor ought to export its internal knowledge to make it easy for consuming code and projects. Developed in https://github.com/WordPress/wordpress-develop/pull/6600 Discussed in https://core.trac.wordpress.org/ticket/61257 Fixes #61257. Props dmsnell, jonsurrell. Built from https://develop.svn.wordpress.org/trunk@58192 git-svn-id: http://core.svn.wordpress.org/trunk@57655 1a063a9b-81f0-0310-95a4-ce76da25c4cd |
||
---|---|---|
.. | ||
class-wp-html-active-formatting-elements.php | ||
class-wp-html-attribute-token.php | ||
class-wp-html-open-elements.php | ||
class-wp-html-processor-state.php | ||
class-wp-html-processor.php | ||
class-wp-html-span.php | ||
class-wp-html-tag-processor.php | ||
class-wp-html-text-replacement.php | ||
class-wp-html-token.php | ||
class-wp-html-unsupported-exception.php | ||
html5-named-character-references.php |