You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a node with an anchor is replaced by a different node, the anchor is lost and any aliases referring to it will fail to stringify properly.
To Reproduce
constdoc=YAML.parseDocument('foo: &a A\nbar: *a\n')// This modifies the existing Scalardoc.set('foo','B')String(doc)// → 'foo: &a B\nbar: *a\n'// This replaces the Scalardoc.set('foo',doc.createNode('C'))String(doc)// → Uncaught Error: Alias node must be after source node
Expected behaviour
Either anchors should be automatically re-assigned, or it should bepossible/easy to ensure that happens.
Versions (please complete the following information):
yaml: all
Additional context
This is effectively a different expression of the "Fix self-referential aliases on custom collections" todo item on #203, as a good solution to this will also provide a good solution to that.
The text was updated successfully, but these errors were encountered:
The original buggy part of this is getting fixed by #248, so I'm going to close this for now. The wontfix label is here for the surprising-behaviour part, because I don't think there's a good API change for it that wouldn't either be really clumsy, or be actually less surprising.
Describe the bug
When a node with an anchor is replaced by a different node, the anchor is lost and any aliases referring to it will fail to stringify properly.
To Reproduce
Expected behaviour
Either anchors should be automatically re-assigned, or it should bepossible/easy to ensure that happens.
Versions (please complete the following information):
yaml
: allAdditional context
This is effectively a different expression of the "Fix self-referential aliases on custom collections" todo item on #203, as a good solution to this will also provide a good solution to that.
The text was updated successfully, but these errors were encountered: