We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When attempting to parse the following YAML, the parser gets into an infinite loop, neither successfully parsing nor throwing an error.
--- | hi
I am not sure which is correct according to the YAML spec: is this an invalid YAML document? Or should it parse to the string "hi"?
The text was updated successfully, but these errors were encountered:
What version do you use? We fixed similar bug last week
Sorry, something went wrong.
I'm using the latest version, 3.2.1. It also occurs in the online demo at http://nodeca.github.io/js-yaml/
I noticed that your code is checking if the next character in the stream is !== 0 in many places, as a sort of "end-of-stream" marker. https://github.com/nodeca/js-yaml/blob/master/lib/js-yaml/loader.js#L856
!== 0
The original PyYAML code explicitly appends this null character to the end of the input text before parsing. http://pyyaml.org/browser/pyyaml/trunk/lib/yaml/reader.py#L75
Perhaps that's the problem? In JS when you str.charCodeAt(str.length) you get NaN, not 0.
str.charCodeAt(str.length)
EDIT: Nevermind, I now see where you're appending the null character in js-yaml.
Fix infinite loop on unindeted block scalars
c092026
Related to issue #144
Fixed
No branches or pull requests
When attempting to parse the following YAML, the parser gets into an infinite loop, neither successfully parsing nor throwing an error.
I am not sure which is correct according to the YAML spec: is this an invalid YAML document? Or should it parse to the string "hi"?
The text was updated successfully, but these errors were encountered: