Skip to content

HTML API: Update Processing Instruction handling#12424

Draft
sirreal wants to merge 25 commits into
WordPress:trunkfrom
sirreal:html-api/update-processing-instruction-parse
Draft

HTML API: Update Processing Instruction handling#12424
sirreal wants to merge 25 commits into
WordPress:trunkfrom
sirreal:html-api/update-processing-instruction-parse

Conversation

@sirreal

@sirreal sirreal commented Jul 6, 2026

Copy link
Copy Markdown
Member

Processing instruction parsing has been updated in the HTML standard. <?processing instructions ?> were transformed into comments, but are now preserved.

See the processing instruction states in the standard.

See #12423 (merged here) for the test addition..

Trac ticket: https://core.trac.wordpress.org/ticket/65582

Use of AI Tools

AI assistance: Yes
Tool(s): Claude
Model(s): Fable 5
Used for: Initial implementation.


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.

sirreal added 18 commits July 3, 2026 14:55
The HTML standard has added Processing Instruction parsing. The HTML API needs updates to handle PI.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

case '#comment':
case '#funky-comment':
case '#presumptuous-tag':
case '#processing-instruction':

@sirreal sirreal Jul 6, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll assume this is the intention. This entire insertion mode is gone from the current version of the spec: #9298

@sirreal

sirreal commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

This adds PI handling to all the relevant insertion modes. PI handling is notably missing from two places:

This change currently follows the spec for in head noscript but inserts the token in template.

It's unclear whether these are an oversight or not. I've asked and will follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant