Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lacking documentation #1765

Open
eldoy opened this issue Feb 13, 2024 · 1 comment
Open

Lacking documentation #1765

eldoy opened this issue Feb 13, 2024 · 1 comment

Comments

@eldoy
Copy link

eldoy commented Feb 13, 2024

The documentation for this library in the README is lacking. I had to read the source code to actually use it. How about adding a few practical examples of use? Like how to parse, then modify and dump the HTML?

This is apparently how you get the HTML from the dom? Found it by trial and error.

var dom = htmlparser2.parseDocument(html)
// How to modify here before dump?
var html = htmlparser2.DomUtils.getOuterHTML(dom)

How do you actually modify the HTML before you dump it?

@blizzardengle
Copy link

For anyone else looking here is most of the options:

export interface ParserOptions {

There are two more options inherited from the domhandler: https://github.com/fb55/domhandler/blob/08839ace0346ac406d3621b2f1c70fa61914a130/src/index.ts#L16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants