|
213 | 213 | * |
214 | 214 | * ### Bookmarks |
215 | 215 | * |
216 | | - * While scanning through the input HTMl document it's possible to set |
| 216 | + * 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 |
219 | 219 | * the set bookmarks and then proceed again from that point forward. |
|
286 | 286 | * |
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 the it's not possible to match the closing tag for a |
| 289 | + * 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. |
292 | 292 | * |
|
298 | 298 | * closing the SCRIPT from inside a JavaScript string. E.g. `console.log( '</script>' )`. |
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`, `NOSCRIPT`, `NOEMBED`, `NOFRAME`, `STYLE` whose contents are treated as |
| 301 | + * - `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 | * |
304 | 304 | * #### Other tokens with modifiable text. |
|
329 | 329 | * and disallows "xml" as a name, since it's special. The Tag Processor only recognizes |
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 transforms |
| 332 | + * since Processing Instructions do not exist within HTML and their syntax transforms |
333 | 333 | * into a bogus comment in the DOM. |
334 | 334 | * |
335 | 335 | * ## Design and limitations |
@@ -521,7 +521,7 @@ class WP_HTML_Tag_Processor { |
521 | 521 | * - A TABLE start tag `<table>` implicitly closes any open `P` element. |
522 | 522 | * |
523 | 523 | * - In `QUIRKS_MODE`: |
524 | | - * - CSS class and ID selectors match match in 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. |
527 | 527 | * |
@@ -614,12 +614,12 @@ class WP_HTML_Tag_Processor { |
614 | 614 | * Example: |
615 | 615 | * |
616 | 616 | * <div id="test">... |
617 | | - * 012345678901234 |
618 | | - * - token length is 14 - 0 = 14 |
| 617 | + * 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 17 - 2 = 15 |
| 622 | + * - token length is 18 - 2 = 16 |
623 | 623 | * |
624 | 624 | * @since 6.5.0 |
625 | 625 | * |
@@ -926,8 +926,6 @@ public function next_tag( $query = null ): bool { |
926 | 926 | * - a DOCTYPE declaration. |
927 | 927 | * - a processing instruction, e.g. `<?xml version="1.0" ?>`. |
928 | 928 | * |
929 | | - * The Tag Processor currently only supports the tag token. |
930 | | - * |
931 | 929 | * @since 6.5.0 |
932 | 930 | * @since 6.7.0 Recognizes CDATA sections within foreign content. |
933 | 931 | * |
@@ -1073,7 +1071,7 @@ private function base_class_next_token(): bool { |
1073 | 1071 | * |
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 to tag to point to the opening of the special atomic |
| 1074 | + * the closing tag to point to the opening of the special atomic |
1077 | 1075 | * tag sequence. |
1078 | 1076 | */ |
1079 | 1077 | $tag_name_starts_at = $this->tag_name_starts_at; |
@@ -1149,7 +1147,7 @@ private function base_class_next_token(): bool { |
1149 | 1147 | * Example: |
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 | * |
1155 | 1153 | * @since 6.5.0 |
@@ -2525,7 +2523,7 @@ private function apply_attributes_updates( int $shift_this_point ): int { |
2525 | 2523 | * replacement must be made before all others which follow it |
2526 | 2524 | * at later string indices in the input document. |
2527 | 2525 | * |
2528 | | - * Sorting avoid making out-of-order replacements which |
| 2526 | + * Sorting avoids making out-of-order replacements which |
2529 | 2527 | * can lead to mangled output, partially-duplicated |
2530 | 2528 | * attributes, and overwritten attributes. |
2531 | 2529 | */ |
@@ -3561,9 +3559,9 @@ public function get_full_comment_text(): ?string { |
3561 | 3559 | * true === $processor->next_token(); // Text is "Apples & Oranges". |
3562 | 3560 | * false === $processor->subdivide_text_appropriately(); |
3563 | 3561 | * |
3564 | | - * $processor = new WP_HTML_Tag_Processor( " \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(); |
3569 | 3567 | * |
@@ -4941,7 +4939,7 @@ public function get_doctype_info(): ?WP_HTML_Doctype_Info { |
4941 | 4939 | * </2> |
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. |
4947 | 4945 | * |
|
0 commit comments