- Timestamp:
- 06/16/2026 09:48:47 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r62492 r62507 214 214 * ### Bookmarks 215 215 * 216 * While scanning through the input HTM ldocument it's possible to set216 * While scanning through the input HTML document it's possible to set 217 217 * a named bookmark when a particular tag is found. Later on, after 218 218 * continuing to scan other tags, it's possible to `seek` to one of … … 287 287 * For these elements the Tag Processor treats the entire sequence as one, 288 288 * from the opening tag, including its contents, through its closing tag. 289 * This means that theit's not possible to match the closing tag for a289 * This means that it's not possible to match the closing tag for a 290 290 * SCRIPT element unless it's unexpected; the Tag Processor already matched 291 291 * it when it found the opening tag. … … 299 299 * - `TITLE` and `TEXTAREA` whose contents are treated as plaintext and then any 300 300 * character references are decoded. E.g. `1 < 2 < 3` becomes `1 < 2 < 3`. 301 * - `IFRAME`, `NO SCRIPT`, `NOEMBED`, `NOFRAME`, `STYLE` whose contents are treated as301 * - `IFRAME`, `NOEMBED`, `NOFRAMES`, `STYLE` whose contents are treated as 302 302 * raw plaintext and left as-is. E.g. `1 < 2 < 3` remains `1 < 2 < 3`. 303 303 * … … 330 330 * target names with an ASCII-representable subset of characters. It also exhibits the 331 331 * same constraint as with CDATA sections, in that `>` cannot exist within the token 332 * since Processing Instructions do no exist within HTML and their syntax transforms332 * since Processing Instructions do not exist within HTML and their syntax transforms 333 333 * into a bogus comment in the DOM. 334 334 * … … 522 522 * 523 523 * - In `QUIRKS_MODE`: 524 * - CSS class and ID selectors match matchin an ASCII case-insensitive manner.524 * - CSS class and ID selectors match in an ASCII case-insensitive manner. 525 525 * - A TABLE start tag `<table>` opens a `TABLE` element as a child of a `P` 526 526 * element if one is open. … … 615 615 * 616 616 * <div id="test">... 617 * 012345678901234 618 * - token length is 1 4 - 0 = 14617 * 0123456789012345 618 * - token length is 15 - 0 = 15 619 619 * 620 620 * a <!-- comment --> is a token. 621 621 * 0123456789 123456789 123456789 622 * - token length is 1 7 - 2 = 15622 * - token length is 18 - 2 = 16 623 623 * 624 624 * @since 6.5.0 … … 926 926 * - a DOCTYPE declaration. 927 927 * - a processing instruction, e.g. `<?xml version="1.0" ?>`. 928 *929 * The Tag Processor currently only supports the tag token.930 928 * 931 929 * @since 6.5.0 … … 1074 1072 * Preserve the opening tag pointers, as these will be overwritten 1075 1073 * when finding the closing tag. They will be reset after finding 1076 * the closing t o tag to point to the opening of the special atomic1074 * the closing tag to point to the opening of the special atomic 1077 1075 * tag sequence. 1078 1076 */ … … 1150 1148 * 1151 1149 * $processor = new WP_HTML_Tag_Processor( '<input type="text" value="Th' ); 1152 * false === $processor-> get_next_tag();1150 * false === $processor->next_tag(); 1153 1151 * true === $processor->paused_at_incomplete_token(); 1154 1152 * … … 2526 2524 * at later string indices in the input document. 2527 2525 * 2528 * Sorting avoid making out-of-order replacements which2526 * Sorting avoids making out-of-order replacements which 2529 2527 * can lead to mangled output, partially-duplicated 2530 2528 * attributes, and overwritten attributes. … … 3562 3560 * false === $processor->subdivide_text_appropriately(); 3563 3561 * 3564 * $processor = new WP_HTML_Tag_Processor( "&#x 13; \r\n\tMore" );3565 * true === $processor->next_token(); // Text is "  ␉More".3566 * true === $processor->subdivide_text_appropriately(); // Text is "  ␉".3562 * $processor = new WP_HTML_Tag_Processor( "
 \r\n\tMore" ); 3563 * true === $processor->next_token(); // Text is "␍ ␊␉More". 3564 * true === $processor->subdivide_text_appropriately(); // Text is "␍ ␊␉". 3567 3565 * true === $processor->next_token(); // Text is "More". 3568 3566 * false === $processor->subdivide_text_appropriately(); … … 4942 4940 * 4943 4941 * Funky comments are tag closers with invalid tag names. Note 4944 * that in HTML these are turn into bogus comments. Nonetheless,4942 * that in HTML these are turned into bogus comments. Nonetheless, 4945 4943 * the Tag Processor recognizes them in a stream of HTML and 4946 4944 * exposes them for inspection and modification.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)