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

Cannot read property 'end' of null #11

Closed
danielepolencic opened this issue Aug 1, 2020 · 5 comments
Closed

Cannot read property 'end' of null #11

danielepolencic opened this issue Aug 1, 2020 · 5 comments
Labels
👀 no/external This makes more sense somewhere else

Comments

@danielepolencic
Copy link

start = pos && pos.startTag && position(pos.startTag).end

position(pos.startTag) could return null, but that branch isn't expected by the code that fails.

@ChristianMurphy
Copy link
Member

Did this actually happen in practice?
If so could you share some content that cause this to happen?

@ChristianMurphy ChristianMurphy added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Aug 1, 2020
@danielepolencic
Copy link
Author

danielepolencic commented Aug 1, 2020

Yes, I have an error in the code that led me down that path.
Here's the input: https://gist.github.com/danielepolencic/67013b543f1938858aa68c41095b2156
(I use hast-util-raw to parse that html)

@ChristianMurphy ChristianMurphy added good first issue 👋 This may be a great place to get started! help wanted 🙏 This could use your insight or help 🙆 yes/confirmed This is confirmed and ready to be worked on and removed 🙉 open/needs-info This needs some more info labels Aug 1, 2020
@ChristianMurphy
Copy link
Member

Thanks!
A pull request to address this would be welcome!

@danielepolencic
Copy link
Author

I will raise a PR later today. Thanks

@wooorm
Copy link
Member

wooorm commented Aug 1, 2020

Might (Also) be an issue in parse5 if they don't provide the correct positional information 🤔

@wooorm wooorm added 👀 no/external This makes more sense somewhere else and removed good first issue 👋 This may be a great place to get started! help wanted 🙏 This could use your insight or help 🐛 type/bug This is a problem 🙆 yes/confirmed This is confirmed and ready to be worked on labels Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else
Development

Successfully merging a pull request may close this issue.

3 participants