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

What is the difference between default and htmlparser2 tree adapters? #5

Closed
domenic opened this issue Jul 5, 2014 · 1 comment
Closed

Comments

@domenic
Copy link

domenic commented Jul 5, 2014

We are hoping to make parse5 the default in jsdom (jsdom/jsdom#818). I am curious whether we should just use the htmlparser2 adapter, and change none of our code, or if we should adopt the default parse5 format? Are there benefits?

@inikulin
Copy link
Owner

inikulin commented Jul 7, 2014

Hi, this is awesome news. default tree adapter was an original tree format for parse5 and it was designed to fit better into W3C-proposed HTML5 parser algorithm. Later I've implemented htmlparser2 tree adapter, so parse5 can be plugged into existing solutions that uses htmlparser2 tree format. There is a little performance penalty, but it's pretty insignificant. For jsdom I suggest to keep htmlparser2 tree format because given performance benefits will not cost effort spent on the tree format change. However, htmlparser2 tree adapter just mimics HTML Node's interfaces provided by htmlparser2, many other details (like named entity representation in text nodes, tree-hierarchy) may obviously differ from htmlparser2 due to completely different parsing algorithm (but it will almost same as in modern browsers).

@inikulin inikulin closed this as completed Jul 7, 2014
inikulin added a commit that referenced this issue Apr 16, 2018
CDATA section errors and tag name error generalization
43081j pushed a commit to 43081j/parse5 that referenced this issue Dec 28, 2021
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.4 to 4.5.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.4.4...v4.5.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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