Commit Graph

2 Commits

Author SHA1 Message Date
8ad5281bad HTML API: Improve private method name used by WP_HTML_Processor::next_token().
This renames the private `_next_token` method to `next_visitable_token`. It also removes irrelevant assertions from the unit test.

Follow-up to [59285].

Props dmsnell, jonsurrell, westonruter.
See #62269.


git-svn-id: https://develop.svn.wordpress.org/trunk@59364 602fd350-edb4-49c9-b593-d223f7449a82
2024-11-06 19:22:22 +00:00
6573ea6e3c HTML API: Fix extensibility of WP_HTML_Processor::next_token().
Break out logic from the `next_token()` method into a private method which may call itself recursively. This allows for subclasses to override the `next_token()` method and be assured that each call to `next_token()` corresponds with the consumption of one single token. This also parallels how `WP_HTML_Tag_Processor::next_token()` wraps a private `base_class_next_token()` method.

Props westonruter, jonsurrell.
Fixes #62269.


git-svn-id: https://develop.svn.wordpress.org/trunk@59285 602fd350-edb4-49c9-b593-d223f7449a82
2024-10-23 22:03:23 +00:00