Repository navigation
Fix CI on ubuntu-26.04, whose libxml2 parses HTML as HTML5 - #90
Merged
Merged
Conversation
GitHub's ubuntu-latest is now ubuntu-26.04, which ships libxml2 2.15. libxml2 2.14 rewrote the HTML tokenizer to follow HTML5: `<?...>` is read as a bogus comment, not a processing instruction, and parse errors are no longer reported. - Skip the tests that need the old parser, detected by probing libxml rather than reading LIBXML_VERSION (the build-time version) - Move the issue #65 tests that run on any libxml into their own class, so Issue65Test skips once in set_up() - Pin the comment round trip libxml 2.14+ produces - Run the coverage job on ubuntu-24.04 so the issue #65 fix stays exercised, and only on PHP 8.3 (the old include applied report: true to every job) - Bump actions/checkout to v7 and codecov/codecov-action to v7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
============================================
- Coverage 90.18% 89.84% -0.35%
+ Complexity 1433 1430 -3
============================================
Files 26 26
Lines 3219 3189 -30
============================================
- Hits 2903 2865 -38
- Misses 316 324 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub's
ubuntu-latestis nowubuntu-26.04, which ships libxml2 2.15. Since 2.14, libxml2's HTML tokenizer follows HTML5:<?php ... ?>is read as a bogus comment (<!--?php ... ?-->), not a processing instructionloadHTML()no longer reports parse errors, even for invalid bytes or undefined entitiesThat broke 18
Issue65Testtests andDOMQueryTest::testFailedParseHTMLElement(27 failures, 1 error). Neither can apply on the new parser: there is no processing instruction to normalise, and no error to turn into aParseException.Changes
TestCase::libxmlParsesHtmlAsHtml5()probes the parser once and caches the result. It doesn't readLIBXML_VERSION, because that is the libxml PHP was built against, not necessarily the one it runs with.requireLegacyHtmlParser()skips on it.Issue65ParserIndependentTest, soIssue65Testskips once inset_up().ubuntu-24.04, so CI still runs the issue Processing instructions gain an extra "?" when an HTML-parsed document is serialized with html()/innerHTML() #65 fix and Codecov still sees it. The oldinclude: - php: '8.3'added a key the matrix doesn't have, which appliedreport: trueto every job; coverage now runs on 8.3 only.actions/checkoutv6 → v7 andcodecov/codecov-actionv5 → v7. checkout v7 only changespull_request_target/workflow_run, which aren't used here. The codecovdirectoryandtokeninputs are unchanged.htmlqp().Testing
ubuntu:26.04container): 395 tests, 30 skipped, 0 failurescomposer run lintandcomposer run lint:min-phpare clean🤖 Generated with Claude Code