Changeset 57542
- Timestamp:
- 02/06/2024 07:21:36 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-tag-processor.php
r57527 r57542 1529 1529 if ( $at > $was_at ) { 1530 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. 1531 * A "<" normally starts a new HTML tag or syntax token, but in cases where the 1532 * following character can't produce a valid token, the "<" is instead treated 1533 * as plaintext and the parser should skip over it. This avoids a problem when 1534 * following earlier practices of typing emoji with text, e.g. "<3". This 1535 * should be a heart, not a tag. It's supposed to be rendered, not hidden. 1536 * 1537 * At this point the parser checks if this is one of those cases and if it is 1538 * will continue searching for the next "<" in search of a token boundary. 1535 1539 * 1536 1540 * @see https://html.spec.whatwg.org/#tag-open-state … … 1538 1542 if ( strlen( $html ) > $at + 1 ) { 1539 1543 $next_character = $html[ $at + 1 ]; 1540 $at_another_node = 1544 $at_another_node = ( 1541 1545 '!' === $next_character || 1542 1546 '/' === $next_character || 1543 1547 '?' === $next_character || 1544 ( 'A' <= $next_character && $next_character <= 'z' ); 1548 ( 'A' <= $next_character && $next_character <= 'Z' ) || 1549 ( 'a' <= $next_character && $next_character <= 'z' ) 1550 ); 1545 1551 if ( ! $at_another_node ) { 1546 1552 ++$at;
Note: See TracChangeset
for help on using the changeset viewer.