jhy/jsoup ? reverse-engineered prompt
Reverse engineered prompt
Build me a Java library for working with real world HTML and XML.
I want it to fetch pages from a URL or read HTML from a string or file, parse it into a DOM that handles messy broken markup sensibly, and let me find content with CSS selectors and xpath. It should also let me edit elements, attributes, and text, then output clean tidy HTML again.
Please include a simple API for common things like getting a page title, selecting elements, reading links, and extracting text. I also need a safe HTML cleaning feature so I can sanitize user submitted content and prevent XSS. Make it stable, well tested, and easy to use in regular Java projects, with clear examples and docs. If you need to check current behavior or standards, look up the latest docs online as needed.
Are you gonna build this?
make sure you review the code using coderabbit