WordPress/wp-includes/html-api
Bernhard Reiter ff3fde39ee HTML API: Add method to create fragment at node.
HTML Fragment parsing always happens with a context node, which may impact how a fragment of HTML is parsed. HTML Fragment Processors can be instantiated with a `BODY` context node via `WP_HTML_Processor::create_fragment( $html )`.

This changeset adds a static method called `create_fragment_at_current_node( string $html_fragment )`. It can only be called when the processor is paused at a `#tag`, with some additional constraints:

- The opening and closing tags must appear in the HTML input (no virtual tokens).
- No "self-contained" elements are allowed ( `IFRAME`, `SCRIPT`, `TITLE`, etc.).

If successful, the method will return a `WP_HTML_Processor` instance whose context is inherited from the node that the method was called from.

Props jonsurrell, bernhard-reiter, gziolo.
Fixes #62357.
Built from https://develop.svn.wordpress.org/trunk@59444


git-svn-id: http://core.svn.wordpress.org/trunk@58830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-11-21 13:29:18 +00:00
..
class-wp-html-active-formatting-elements.php
class-wp-html-attribute-token.php HTML API: Track spans of text with (offset, length) instead of (start, end). 2023-12-10 13:19:28 +00:00
class-wp-html-decoder.php HTML API: Add missing `@global` tag on HTML Decoder. 2024-09-02 20:55:14 +00:00
class-wp-html-doctype-info.php
class-wp-html-open-elements.php HTML API: Ensure that full processor can seek to earlier bookmarks. 2024-11-12 10:32:17 +00:00
class-wp-html-processor-state.php
class-wp-html-processor.php HTML API: Add method to create fragment at node. 2024-11-21 13:29:18 +00:00
class-wp-html-span.php HTML API: Add PHP type annotations. 2024-07-19 23:44:16 +00:00
class-wp-html-stack-event.php HTML API: Add PHP type annotations. 2024-07-19 23:44:16 +00:00
class-wp-html-tag-processor.php HTML API: Fix the position update after changing the modifiable text when length differs 2024-10-18 13:31:17 +00:00
class-wp-html-text-replacement.php
class-wp-html-token.php HTML API: Add support for SVG and MathML (Foreign content) 2024-08-08 07:25:15 +00:00
class-wp-html-unsupported-exception.php HTML API: Add context to Unsupported_Exception class for improved debugging. 2024-07-12 22:29:13 +00:00
html5-named-character-references.php Introduce Token Map: An optimized static translation class. 2024-05-23 19:56:08 +00:00