Closed
Description
Describe the bug
When I test YAML packages, I found some seemingly correct YAML cannot be parsed by this package.
Specifically, when tags or anchors occur in all but first implicit key, and map containing such key is not the top level node, this package reports a syntax error.
To Reproduce
var yaml = require('yaml');
var doc1 = `
some:
!!str &a1 "foo":
!!str bar
&a2 baz : *a1`;
// error on yaml
console.log(yaml.parse(doc1));
Expected behaviour
I don't know if this is legal YAML. However, line 2 ~ 4 of doc1 is copied from yaml 1.2.2 spec.
Versions (please complete the following information):
- Environment:
Node.js
: 16.13.1yaml
: 2.0.0js-yaml
: 4.1.0