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

Does not work for documents with an implied <head> #27

Open
kevincox opened this issue Jul 23, 2024 · 0 comments
Open

Does not work for documents with an implied <head> #27

kevincox opened this issue Jul 23, 2024 · 0 comments

Comments

@kevincox
Copy link

kevincox commented Jul 23, 2024

Right now the code uses a simple regex to parse out the <head> this regex is insufficient for a few reasons.

  1. Fails to extract content in an implied <head> element.
  2. Fails to handle cases like </head thisisignored> to close the head.

HTML5 is a ugly mess but it is best to properly handle it. This means using a proper parser based on the doctype declaration because you can't parse HTML with regex.

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

1 participant