Skip to content

Conversation

@sirreal
Copy link
Member

@sirreal sirreal commented Aug 6, 2024

  • Fix an issue where </# is not treated as incomplete input but </# is. Both should be incomplete input.
  • Add a test for the issue.

The HTML Tag Processor may report ::paused_at_incomplete_token() === true correctly when the HTML ends in an open "funky comment."

The HTML </# should be handled the same as </# , in both cases a funky comment has been opened but no closer is found before the HTML document ends. Both cases should both be treated as incomplete input, however the former case (with no trailing space) does not report an incomplete token.

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


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 2 commits August 6, 2024 12:18
A state change was missing when the input is too short to find a comment
closer in an opened funky comment. This fixes a issue where `</#` does
not correctly report incomplete input, but `</# ` does.
@github-actions
Copy link

github-actions bot commented Aug 6, 2024

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell, dmsnell.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

github-actions bot commented Aug 6, 2024

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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • 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.

Copy link
Member

@dmsnell dmsnell left a comment

Choose a reason for hiding this comment

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

This is a good find. Thank you @sirreal

pento pushed a commit that referenced this pull request Aug 6, 2024
…pause.

A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in #7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.


git-svn-id: https://develop.svn.wordpress.org/trunk@58858 602fd350-edb4-49c9-b593-d223f7449a82
@dmsnell
Copy link
Member

dmsnell commented Aug 6, 2024

Merged in [58858]
534b830

@dmsnell dmsnell closed this Aug 6, 2024
@dmsnell dmsnell deleted the html-api/fix-unclosed-comment-bug branch August 6, 2024 20:43
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Aug 6, 2024
…pause.

A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in WordPress/wordpress-develop#7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.

Built from https://develop.svn.wordpress.org/trunk@58858


git-svn-id: http://core.svn.wordpress.org/trunk@58254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to gilzow/wordpress-performance that referenced this pull request Aug 6, 2024
…pause.

A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in WordPress/wordpress-develop#7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.

Built from https://develop.svn.wordpress.org/trunk@58858


git-svn-id: https://core.svn.wordpress.org/trunk@58254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
aslamdoctor pushed a commit to aslamdoctor/wordpress-develop that referenced this pull request Dec 28, 2024
…pause.

A state change was missing in the Tag Processor when the input is too short to
find a comment closer after an opened funky comment. This patch fixes a issue
where `</#` does not correctly report incomplete input, but `</# ` does.

Developed in WordPress#7146
Discussed in https://core.trac.wordpress.org/ticket/61831

Props: jonsurrell.
Fixes #61831.


git-svn-id: https://develop.svn.wordpress.org/trunk@58858 602fd350-edb4-49c9-b593-d223f7449a82
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.

2 participants