-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Parsing non-octal leading-zero numeric strings with YAML 1.1 directive should be strings #684
Comments
MariteSomEnergia
added a commit
to Som-Energia/opendata-ui
that referenced
this issue
Oct 17, 2023
Due to a bug in js-yaml, non-octal 0 padded numeric codes are parsed as number instead strings and we are losing the code zero padding. nodeca/js-yaml#684 Co-authored-by: David García Garzón <[email protected]>
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 11, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 12, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 12, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 12, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 12, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 14, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
vokimon
added a commit
to Som-Energia/somenergia-tomatic
that referenced
this issue
Mar 22, 2024
workarround for jsyaml bug on numeric strings with leading zeroes See nodeca/js-yaml#684
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In YAML 1.1, numeric scalars with leading zeros that include characters 8 or 9 do not need to be quoted. For example, the scalar
083
must be a string as it can't be a valid octal value. In YAML 1.2,083
is interpreted as a number.My understanding is that a YAML directive in a YAML document should allow a YAML processor to distinguish between these specifications. For example, given the following document:
The yaml processor should know to interpret the scalar
083
as the string"083"
instead of as the number83
. js-yaml interprets the value as the number83
. Here's an examplepackage.json
andindex.js
I'd expect both of these to parse as the string
"083"
given the%YAML 1.1
directive.The text was updated successfully, but these errors were encountered: