-
-
Notifications
You must be signed in to change notification settings - Fork 250
refactor(tokenizer): Use entities' new decoder #897
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
Conversation
| "preset": "ts-jest/presets/default-esm", | ||
| "testEnvironment": "node", | ||
| "coverageProvider": "v8", | ||
| "globals": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change, but this removes a deprecation warning from ts-jest. There is no change in behavior.
Allows some logic to be simplified
|
Sorry, I have no knowledge of the I am not sure about your point “The remaining use, waiting for sequences, can be removed in a future patch”. Why is it a good thing to remove that? I personally use hibernation to pass different sequences through. |
|
I'll have a read through 👍 |
43081j
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry it took so long, i've been away recently
looks good to me, though i haven't had chance to read much into the entities package in your repo
|
Thanks for the review! |
entities@4.5.0features anEntityDecoderthat implements the entity decoding logic from this module in a way that can be shared between my three projects working with HTML entities (other PRs: fb55/entities#1136, fb55/htmlparser2#1480).With this change, the main use-case for hibernation is removed. The remaining use, waiting for sequences, can be removed in a future patch, which should make it easier to follow the logic in the tokenizer (I was surprised several times by unintuitive flows while working on this PR).
Ultimately, I'd like to see both htmlparser2 and parse5 become more modular, which will make them easier to maintain, and should provide a big speed boost — https://github.com/marko-js/htmljs-parser is currently the fastest parser in https://github.com/AndreasMadsen/htmlparser-benchmark, using a modular design to great effect.