[wp-trac] [WordPress Trac] #62357: HTML API: Allow creating fragment parser from a context node
WordPress Trac
noreply at wordpress.org
Thu Nov 7 12:44:38 UTC 2024
#62357: HTML API: Allow creating fragment parser from a context node
-----------------------------+-----------------------------
Reporter: jonsurrell | Owner: jonsurrell
Type: feature request | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: HTML API | Version:
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
The HTML API has two ways of creating HTML processors, `create_fragment`
and
`create_full_parser`.
`create_fragment` is a static method that creates a fragment parser from a
very reasonable default context node, a `BODY` element.
However, it may be necessary to create a fragment parser with a different
context node, for example when working with HTML inside of an SVG or TABLE
tag may be parsed very differently.
One strong motivation for this is the implementation of a `set_inner_html`
method which requires parsing an HTML fragment with the appropriate
context node in order to change its contents.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62357>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list