-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
Incorrectly parsing text from script #770
Comments
This is likely caused by a breaking change in 7.0.0 (see https://github.com/inikulin/parse5/releases/tag/v7.0.0), which will now emit multiple text events for long sections (where we drop the underlying buffer). This is a bug fix for a long standing issue within parse5, where the raw text was not reliable. Hope this makes sense! |
This is the relevant PR: #432 |
@fb55 I wasn't observing multiple test events for long sections. Only the last portion of the text was being sent. Is that expected at all? |
Looking at the code in the first post of this issue, the important thing to note is that the Looking at cypress' source code, this function doesn't deal with multiple text events for script tags (the relevant logic should be moved to |
@fb55 Sorry for the late replay. THANK YOU for taking a deeper look into this. I will give this a shot and see if this resolves the issue. |
We are using the
parse5-html-rewriting-stream
, to parse html & js body content from intercepted browser requests.This work well, but recently stumbled across an issue where the following
script
content were being incorrectly/partially emitted when the internal contents were JS setting a constant to a JSON.The
startTag
event is correctly emitting:<script>
as the raw contents, but thetext
event is sending part of the JS object in the raw contents:I expect the raw contents of the
text
event to match the full contents.The text was updated successfully, but these errors were encountered: