Make WordPress Core

Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#63823 closed enhancement (fixed)

HTML API: Make WP_HTML_Processor::serialize_token() public.

Reported by: dmsnell Owned by:
Priority: normal Milestone: 6.9
Component: HTML API Version: 6.9
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Follow-up to #62036

The serialize_token() method was added in WordPress 6.7.0 as a
protected member on the WP_HTML_Processor class. It wasn’t clear at
the time of merging if it would be necessary to expose it as a public
method. However, since that time a number of experiments have led to the
conclusion that it would be very valuable to do so.

This patch opens up the method for invocation from the outside,
trivializing the generation of normative HTML subspans from a parent
document.

See the Serialization Builder based on this, and which motivates this change.
https://gist.github.com/dmsnell/ff758c13e8d41bf9f0b75f3fd42ad1e5

Change History (3)

This ticket was mentioned in PR #9456 on WordPress/wordpress-develop by @dmsnell.


13 months ago
#1

  • Keywords has-patch added

Trac ticket: Core-63823
Follows #7331

The serialize_token() method was added in WordPress 6.7.0 as a protected member on the WP_HTML_Processor class. It wasn’t clear at the time of merging if it would be necessary to expose it as a public method. However, since that time a number of experiments have led to the conclusion that it would be very valuable to do so.

This patch opens up the method for invocation from the outside, trivializing the generation of normative HTML subspans from a parent document.

Follow-up to [59076].

#2 @dmsnell
13 months ago

  • Resolutionfixed
  • Status newclosed

In 60633:

HTML API: Make WP_HTML_Processor::serialize_token() public.

The serialize_token() method was added in WordPress 6.7.0 as a protected member on the WP_HTML_Processor class. It wasn’t clear at the time of merging if it would be necessary to expose it as a public method. However, since that time a number of experiments have led to the conclusion that it would be very valuable to do so.

This patch opens up the method for invocation from the outside, trivializing the generation of normative HTML subspans from a parent document.

Developed in https://github.com/WordPress/wordpress-develop/pull/9456
Discussed in https://core.trac.wordpress.org/ticket/63823

Follow-up to [59076].

Props dmsnell, jonsurrell.
Fixes #63823.

@dmsnell commented on PR #9456:


13 months ago
#3

Merged in 60633

Note: See TracTickets for help on using tickets.