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

Is it possible to get the details of attributes? #893

Closed
zhmushan opened this issue Aug 3, 2021 · 1 comment
Closed

Is it possible to get the details of attributes? #893

zhmushan opened this issue Aug 3, 2021 · 1 comment

Comments

@zhmushan
Copy link

zhmushan commented Aug 3, 2021

htmlparser2 demo
hyntax parser demo

In Hyntax, we can get the detailed information of the attribute (startIndex, etc.), but htmlparser2 simply outputs the key-value
Will htmlparser2 support this feature in the future?

@fb55
Copy link
Owner

fb55 commented Aug 27, 2021

#929 makes it possible to track attribute indices. You will have to provide a custom handler to actually store this; have a look at https://github.com/fb55/domhandler/blob/master/src/index.ts for the current handler implementation. You can extend the current handler class, with an updated onattribute method that sets indices as expected.

@fb55 fb55 closed this as completed Aug 27, 2021
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