Docs: Correct the placement of `@see` tags in `WP_HTML_Tag_Processor` class.

This moves a reference link in `::get_attribute_names_with_prefix()` below the code example, so that it is correctly displayed in the Developer Resources.

Includes updating some other `@see` tags for consistency as per the documentation standards.

Additionally, the example code for `WP_HTML_Tag_Processor::get_tag()` is updated to show lowercase tag names in the input HTML, so that it does not convey the wrong impression that the uppercase output from `::get_tag()` depends on the case of the input HTML.

Follow-up to [55203].

Props dmsnell, johnbillion, audrasjb, SergeyBiryukov.
Merges [55724] to the 6.2 branch.
Fixes #58254.
Built from https://develop.svn.wordpress.org/branches/6.2@55728


git-svn-id: http://core.svn.wordpress.org/branches/6.2@55240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-05-08 19:52:21 +00:00
parent 6e932eb677
commit 63f3e3a5a5
2 changed files with 17 additions and 12 deletions

View File

@ -253,9 +253,10 @@ class WP_HTML_Tag_Processor {
* The maximum number of bookmarks allowed to exist at
* any given time.
*
* @see set_bookmark()
* @since 6.2.0
* @var int
*
* @see WP_HTML_Tag_Processor::set_bookmark()
*/
const MAX_BOOKMARKS = 10;
@ -263,9 +264,10 @@ class WP_HTML_Tag_Processor {
* Maximum number of times seek() can be called.
* Prevents accidental infinite loops.
*
* @see seek()
* @since 6.2.0
* @var int
*
* @see WP_HTML_Tag_Processor::seek()
*/
const MAX_SEEK_OPS = 1000;
@ -498,9 +500,10 @@ class WP_HTML_Tag_Processor {
/**
* Tracks and limits `seek()` calls to prevent accidental infinite loops.
*
* @see seek
* @since 6.2.0
* @var int
*
* @see WP_HTML_Tag_Processor::seek()
*/
protected $seek_count = 0;
@ -720,9 +723,10 @@ class WP_HTML_Tag_Processor {
/**
* Skips contents of title and textarea tags.
*
* @see https://html.spec.whatwg.org/multipage/parsing.html#rcdata-state
* @since 6.2.0
*
* @see https://html.spec.whatwg.org/multipage/parsing.html#rcdata-state
*
* @param string $tag_name the lowercase tag name which will close the RCDATA region.
* @return bool Whether an end to the RCDATA region was found before the end of the document.
*/
@ -1281,11 +1285,11 @@ class WP_HTML_Tag_Processor {
* Converts class name updates into tag attributes updates
* (they are accumulated in different data formats for performance).
*
* @see $lexical_updates
* @see $classname_updates
*
* @since 6.2.0
*
* @see WP_HTML_Tag_Processor::$lexical_updates
* @see WP_HTML_Tag_Processor::$classname_updates
*
* @return void
*/
private function class_name_updates_to_attributes_updates() {
@ -1725,8 +1729,6 @@ class WP_HTML_Tag_Processor {
* > case-insensitive match for each other.
* - HTML 5 spec
*
* @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
*
* Example:
* ```php
* $p = new WP_HTML_Tag_Processor( '<div data-ENABLED class="test" DATA-test-id="14">Test</div>' );
@ -1739,6 +1741,8 @@ class WP_HTML_Tag_Processor {
*
* @since 6.2.0
*
* @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2:ascii-case-insensitive
*
* @param string $prefix Prefix of requested attribute names.
* @return array|null List of attribute names, or `null` when no tag opener is matched.
*/
@ -1763,7 +1767,7 @@ class WP_HTML_Tag_Processor {
*
* Example:
* ```php
* $p = new WP_HTML_Tag_Processor( '<DIV CLASS="test">Test</DIV>' );
* $p = new WP_HTML_Tag_Processor( '<div class="test">Test</div>' );
* $p->next_tag() === true;
* $p->get_tag() === 'DIV';
*
@ -2055,7 +2059,8 @@ class WP_HTML_Tag_Processor {
* Returns the string representation of the HTML Tag Processor.
*
* @since 6.2.0
* @see get_updated_html
*
* @see WP_HTML_Tag_Processor::get_updated_html()
*
* @return string The processed HTML.
*/

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2.1-alpha-55722';
$wp_version = '6.2.1-alpha-55728';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.