#61831 closed defect (bug) (fixed)
HTML API: Unclosed "funky comment" may not pause at incomplete token
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.7 | Priority: | normal |
| Severity: | normal | Version: | 6.5 |
| Component: | HTML API | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
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.
Change History (8)
This ticket was mentioned in PR #7146 on WordPress/wordpress-develop by @jonsurrell.
18 months ago
#2
- Keywords has-patch has-unit-tests added
- 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
#3
@
18 months ago
This was discovered by the HTML5lib-tests full HTML API parser tests, in progress in https://github.com/WordPress/wordpress-develop/pull/7117.
This ticket was mentioned in PR #7117 on WordPress/wordpress-develop by @jonsurrell.
18 months ago
#4
Trac ticket: Core-61646
Previously, the html5lib tests have only run in the fragment parser mode, but in #6977 a full parser was introduced to the HTML API. In this patch, the html5lib tests are running in the full parser mode where applicable.
#7146 is merged here and should be landed first.
- Tests: 609, Assertions: 405, Skipped: 204. + Tests: 1498, Assertions: 787, Skipped: 711.
This vastly increases the tests that are used from HTML5lib-tests from 609 to 1498! It's helped to discover two issues:
I've confirmed this in 6.5, but the behavior may have existed earlier.