#60122 closed enhancement (fixed)
HTML API: avoid processing incomplete tokens
| Reported by: | dmsnell | Owned by: | Bernhard Reiter |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.5 |
| Component: | HTML API | Version: | 6.5 |
| Severity: | normal | Keywords: | has-patch has-unit-tests needs-dev-note |
| Cc: | Focuses: |
Description
Currently the Tag Processor assumes that an input document is a full HTML document. Because of this, if there's lingering content after the last tag match it will treat that content as plaintext and skip over it. This is fine for the Tag Processor because if there is lingering content that isn't a valid tag then there's nothing for next_tag() to match.
However, in order to support a number of feature expansions it is important to recognize that the remaining content may involve partial syntax elements, such as incomplete tags, attributes, or comments.
In this patch we're adding a mode inside the Tag Processor which will flip when we start parsing HTML syntax but the document finishes before the token does. This will provide the ability to:
extend the input document
avoid misinterpreting syntax as text
guess if we have a complete document, know if we have an incomplete document
Change History (9)
#2
@
3 years ago
With changeset in trunk during 6.5, please milestone the ticket to 6.5 @bernhard-reiter, thanks!
#5
@
3 years ago
@stevenlinx can you reword what you are stating or asking? I'm not sure what to make of your comment, but it seems like you are asking a question.
#6
@
3 years ago
@dmsnell , thank you for your question.
"misc" means "misc dev note".
It's a term people use within the Release Doc team.
It means, given the size of the change (paragraph sized) and its notability, I designate the dev note to go to the "Miscellaneous developer changes in WordPress X.Y" blog post, which stores a list of paragraph sized dev notes.
If you disagree about its size or where the dev note shall go, you may state the reasons why it should go elsewhere.
If you do agree, nothing need to be done on your end.
#7
@
3 years ago
thanks for clarifying @stevenlinx - the demonstratives "this" and "one" were definitely confusing without more context. I thought you might be talking about classifying the ticket, but I wasn't sure and didn't want to assume.
happy to help note these changes, but in fact I have been preparing one update post for all of the HTML API changes in 6.5. would it be best to ensure this makes it into that post or is there reason to split all the work into separate notes?
https://make.wordpress.org/core/?p=110857&preview=1&_ppp=939d7aa28d
#8
@
3 years ago
"... I have been preparing one update post for all of the HTML API changes in 6.5. would it be best to ensure this makes it into that post"
Thank you for letting me know.
Yes, I think the change in question is better to be placed in the standalone dev note post you linked, along with other HTML API updates.
I'll cross out this dev note being a "misc" one and recategorize it as a "combined minis".
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 57211: