-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
Empty document #195
Comments
parse5 produces such AST if |
Hmm, "never called"? Am I supposed to wait for an event before sending the stream to parse5? const parser = new parse5.ParserStream(options)
.once("finish", () => resolve(parser.document));
input.pipe(parser); If nothing was received, why was "finished" emitted? I'm confused. |
Interesting, seems like node stream doesn't call |
It might not be a bug. But you still may want to take some sort of action on this. I was accidentally using bhttp's |
It's a bug. We give erroneous AST on empty string input (which is still a valid input) |
I have tests with empty string input that correctly produce ASTs with html/head/body elements. |
Try const parser = new parse5.ParserStream(options)
.once("finish", () => resolve(parser.document));
parser.end(); |
That's different than an empty string, though. |
@stevenvachon That's pretty much the same. |
I just noticed that my project's empty string tests were using Also, which file do you want the test in? |
What are the situations in which parse5 would produce this with the streaming API?:
Even an empty document at least produces html/head/body elements in my test suite. I'm getting the above with manual testing with a remote server.
The text was updated successfully, but these errors were encountered: