Repository navigation
Conversation
cheerio 1.x parses input as a full document by default, so a fragment came back wrapped in <html><head></head><body>. inline-css, style-data and list-stylesheets now load input as a fragment unless it has a doctype or an html, head or body tag. Fixes jonkemp#117
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.
Fixes #117.
Since the move to cheerio 1.x, a fragment comes back as a full document:
cheerio 1.x parses input as a document unless
loadis told otherwise by its third argument.lib/inline-css.js,style-dataandlist-stylesheetsnow passfalsefor that argument unless the input has a doctype or anhtml,headorbodytag, so full documents parse exactly as before. All three needed it, because each stage parses and serialises the html again.Each of the three suites has a new test for a fragment, and all three fail without the change. Every existing fixture is a full document, and all 66 tests pass. The changeset bumps all three packages as a patch.