Preserve options#437
Merged
Merged
Conversation
Cheerio.prototype.options are now overwritten if Cheerio is instantiated with an options object. cheerioinstace.options is now passed to parser when adding new dom nodes to an existing Cheerio instance.
as proposed by @jugglinmike in #274
as proposed by @jugglinmike in #274, but using `this.options` instead of the prototype to enable `Cheerio.call` calls to work properly
caused failure of test cases (htmlparser2's behavior depends on the existence of the property) as a reminder for future optimizations, I've added the `decodeEntities` option instead
I'm not sure the behavior is the same (it's now equal to the code above)
Contributor
|
+1 |
Member
Author
|
As far as I can tell, this should be feature-complete. Much less of a rewrite than originally expected. |
Member
|
hmm, is it possible to get away with just using |
Member
Author
|
Moving |
Member
|
yah, i think we should attach it to the prototype then |
Member
Author
|
@matthewmueller done |
Member
|
@fb55 thanks for fixing this awful bug, haha. |
Contributor
|
🎉 🍰 |
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 #273, #256.
Necessary for #261, #248, #275
This is intended to start some progress towards maintaining an options object.
evaluatenow always receives an options object, but there still seem to be some bugs -the newly-added test-cases are failing(not anymore).As this contains a lot of changes, I previously merged all PRs that seemed reasonable to me.
I tried to include everything discussed in #274. If I forgot something, please mention it. Also, feel free to send PRs to the
preserve_optionsbranch :)