Errors when parsing escape characters #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, I was trying to parse a string with escape characters, I got parsing errors for the value with escaped double quotes.
The text I was parsing:
The code I used to check for a parsing error:
I go three logs on the console output (I removed the line numbers for clarity):
I am not sure if I overlook something or I should escape the escape character itself first, like so:
"echo \\"no test specified\\" && exit 1"Thank you for your time.
This code parses without any errors for me in @lezer/json 1.0.2:
You should double-escape those backslashes if you're using them in a JavaScript string literal. I.e. the problem is that your
codestring in that test code doesn't contain any actual backslashes.