Remove module caching dependency ( #1691 by a9d6a43.Fix parentsUntil filtering ( #1708 by bf899d5. ![]() Fix filter for Until ( #1728 by f2615d2.Fix handling of undefined as value in.Fix AttrFunction arguments ( #1669 by 5f2e9c3.Rename exported variable ( #1682 by 897b37f.By setting scriptingEnabled to false, it is now possible to parse the contents of tags.Expose the scriptingEnabled parse5 option ( #1707 by 7eb4cc4.In XML mode, all elements will have type: 'tag'.Some attributes are now case-insensitive based on the HTML spec.Selectors (see Several pseudo selectors are now stricter, in line with the HTML spec.This release contains three breaking changes inherited from dependencies. Fixed the ordering of the output of several methods, including prevAll, prevUntil and parentsUntil.Feedback is greatly appreciated if you encounter a problem, please file an issue! This release does not contain other changes to functionality. attr is not allowed to be called on a Cheerio. You can still use $('.').map() to map to arbitrary values, and will get a compiler error when trying to call method that are not supported.Element is the class representing tags.When calling Cheerio with a selector like $('.foo'), it will produce a Cheerio, as only Elements can be part of the result set.Node is the base class for DOM elements and includes eg.When calling a loaded Cheerio instance with an HTML string like $(''), it will product a Cheerio type.The TypeScript compiler will figure out what structures you are operating on: That means that Cheerio instances can contain objects of arbitrary types, but not all methods can be called on them. These are available starting with TypeScript 4.1, so you might have to bump your TypeScript version.įor TypeScript types, Cheerio now implements the ArrayLike interface. Note: Cheerio uses template literal types to determine return types. made their first contribution in #2453įull Changelog: v1.0.0-rc.10.v1.0.0-rc.11Ĭonst cheerio = require ( "cheerio" ) const $ = cheerio.made their first contribution in #2392.made their first contribution in #2127.made their first contribution in #1934.Update README "is not a web browser" section by in #2127.Set permissions for GitHub actions by in #2453.Remove unnecessary code, be more explicit #2279.Move initialization logic to load #1951.Have style parsing add malformed fields to previous field #2521.Add missing undefined return value #2505.Include undefined in the return type of get by in #2392.Have text turn passed values to strings #2047.Added a slim export, which will always use htmlparser2 #1960.Users can now specify a baseURI option, which will lead to href and src props to be resolved as URLs.Add textContent and innerText props #2214. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |