-
Notifications
You must be signed in to change notification settings - Fork 322
YAML 1.2
Tina Müller (tinita) edited this page Sep 18, 2022
·
7 revisions
From https://yaml.org/spec/1.2.2/ext/changes/
The next-line \x85, line-separator \u2028 and paragraph-separator \u2029 characters are no longer considered line-break characters. Within scalar values, this means that next-line characters will not be included in the white-space normalization. Using any of these outside scalar values is likely to result in errors during parsing. For a relatively robust solution, try replacing \x85 and \u2028 with \n and \u2029 with \n\n.
libyaml still considers those characters as line breaks.
% perl -wE'binmode STDOUT, "encoding(utF-8)";print "- line1\x{2028}- line2\x{2029}- line3\x{85}- line4\n";' >file.yaml
% yamlpp-load file.yaml -M YAML::PP::LibYAML
$doc0 = [
"line1",
"line2",
"line3",
"line4"
];
% yamlpp-load file.yaml -M YAML::PP
$doc0 = [
"line1\x{2028}- line2\x{2029}- line3\x{85}- line4"
];
- Tag shorthands can no longer include any of the characters ,[]{}, but can include #. To work around this, either fix your tag names or use verbatim tags.
- Anchors can no longer include any of the characters ,[]{}.
- Inside double-quoted strings / is now a valid escape for the / character.
- No space is required after the colon in flow style if the key is quoted, e.g. {"key":value}.
- The maximum key length of 1024 characters has been removed for flow mapping keys.
- Quoted content can include practically all Unicode characters.
- Documents in streams are now independent of each other, and no longer inherit preceding document directives if they do not define their own.
- Explicit document-end marker is now always required before a directive.