cheeriojs/cheerio ? reverse-engineered prompt
Reverse engineered prompt
Build me a fast library for working with HTML and XML in Node and in the browser. I want to be able to load a chunk of markup, pick elements with simple jQuery style selectors, change text and attributes, add classes, and then render the updated document back out as HTML.
It should handle messy real world pages well, not just perfect markup, and it should work for both HTML and XML. Keep the API easy to use for people who know jQuery, with a small set of methods for finding, reading, updating, and outputting nodes. Make sure the examples and tests show common scraping and content editing use cases, like changing headings, filtering lists, and grabbing text from nested elements.
If you need to check current parsing behavior or selector support, look up the latest docs online.
Are you gonna build this?
make sure you review the code using coderabbit