- Timestamp:
- 01/30/2024 10:07:42 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r57348 r57489 1513 1513 $at = strpos( $html, '<', $at ); 1514 1514 1515 if ( $at > $was_at ) {1516 $this->parser_state = self::STATE_TEXT_NODE;1517 $this->token_starts_at = $was_at;1518 $this->token_length = $at - $was_at;1519 $this->text_starts_at = $was_at;1520 $this->text_length = $this->token_length;1521 $this->bytes_already_parsed = $at;1522 return true;1523 }1524 1525 1515 /* 1526 1516 * This does not imply an incomplete parse; it indicates that there … … 1534 1524 $this->text_length = $this->token_length; 1535 1525 $this->bytes_already_parsed = strlen( $html ); 1526 return true; 1527 } 1528 1529 if ( $at > $was_at ) { 1530 /* 1531 * A "<" has been found in the document. That may be the start of another node, or 1532 * it may be an "ivalid-first-character-of-tag-name" error. If this is not the start 1533 * of another node the "<" should be included in this text node and another 1534 * termination point should be found for the text node. 1535 * 1536 * @see https://html.spec.whatwg.org/#tag-open-state 1537 */ 1538 if ( strlen( $html ) > $at + 1 ) { 1539 $next_character = $html[ $at + 1 ]; 1540 $at_another_node = 1541 '!' === $next_character || 1542 '/' === $next_character || 1543 '?' === $next_character || 1544 ( 'A' <= $next_character && $next_character <= 'z' ); 1545 if ( ! $at_another_node ) { 1546 ++$at; 1547 continue; 1548 } 1549 } 1550 1551 $this->parser_state = self::STATE_TEXT_NODE; 1552 $this->token_starts_at = $was_at; 1553 $this->token_length = $at - $was_at; 1554 $this->text_starts_at = $was_at; 1555 $this->text_length = $this->token_length; 1556 $this->bytes_already_parsed = $at; 1536 1557 return true; 1537 1558 }
Note: See TracChangeset
for help on using the changeset viewer.