Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#63823 closed enhancement (fixed)

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

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

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.


4 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
4 months ago

  • Resolution set to fixed
  • Status changed from new to closed

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:


4 months ago
#3

Merged in 60633

Note: See TracTickets for help on using tickets.