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

[feature request]: support to automatically appent <html>, <head>, <body> #1864

Open
xusd320 opened this issue Jul 4, 2024 · 2 comments
Open

Comments

@xusd320
Copy link

xusd320 commented Jul 4, 2024

We use cheerio to handle lots of html,and found that htmlparser2 is much faster than parse5 which cheerio used by default, and saving about 40% cpu usage when handling lots of html. But in parse5, it will automatically append <html>, <head>, <body> if those tags are not included in the html input, we depend on this behavior.

image

Consider to add an options to support this feature?

@xusd320
Copy link
Author

xusd320 commented Jul 4, 2024

I can work on this by myself, wish to get some options @fb55 , what do you think about this?

@fb55
Copy link
Owner

fb55 commented Jul 4, 2024

@xusd320 I am a bit worried that this would be a complex feature, especially because of all of the alignment that happens in parse5 (eg. propagating title tags from the body to the head).

Could you give a quick rundown on how you expect this to work, and (if you know already) how it will be implemented?

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