HTML API: Visit implied body at EOF after head#46
Conversation
[P2] Mark EOF-implied BODY nodes as virtual — src/wp-includes/html-api/class-wp-html-processor.php:1072-1072 When EOF is processed after the last real token was an ignored BODY token, such as a full document ending with <template><body> or <noscript></body>, this branch leaves state->current_token pointing at that stale BODY. The implied BODY inserted at EOF is then classified by the stack push handler as the same real token, so next_token() exposes a null token and serialization emits </body> without a matching <body>. Please ensure EOF-created nodes are always treated as virtual, or clear/use a synthetic EOF token before implied nodes are inserted.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Code reviewFound 1 issue:
wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php Lines 231 to 238 in 58dab55 wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php Lines 5264 to 5271 in 58dab55 Also verified (no action needed): the EOF reprocess chains terminate (each 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
# Conflicts: # src/wp-includes/html-api/class-wp-html-processor.php
This updates the `@param` and `@return` descriptions to state that `build_query()` does **not** URL-encode, unlike PHP's native `http_build_query()`, and that callers are responsible for encoding the values beforehand or late-escaping the output with `esc_url()`. Follow-up to [8215]. Props nimeshatxecurify, johnbillion. Fixes #65453. git-svn-id: https://develop.svn.wordpress.org/trunk@62497 602fd350-edb4-49c9-b593-d223f7449a82
…zip.php`. This replaces `Chr()` and `Ord()` with their canonical lowercase forms `chr()` and `ord()`. This is flagged as a case-sensitivity violation by the upcoming [https://wiki.php.net/rfc/case_sensitive_php PHP 8.6 RFC], which will emit `E_DEPRECATED` for function references that don't match their declared casing. Fixing it now keeps WordPress ahead of the deprecation. Props Soean. See #64897. git-svn-id: https://develop.svn.wordpress.org/trunk@62498 602fd350-edb4-49c9-b593-d223f7449a82
This removes an unused variable in `WP_Interactivity_API::data_wp_class_processor()`. Follow-up to [57563], [61020]. Props Soean. See #64897. git-svn-id: https://develop.svn.wordpress.org/trunk@62499 602fd350-edb4-49c9-b593-d223f7449a82
Summary
<body>and virtual EOF closers after documents ending inin headorafter headstates.Testing
codex review --base trunk.Trac ticket: https://core.trac.wordpress.org/ticket/65372
Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: PR description cleanup and code review.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.