how to preserve YAML anchor ? #303
Replies: 4 comments 13 replies
-
I found the answer. You should not use In case somebody else hits the same problem. Could somebody elaborate on the differences between |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm using this package on alacritty-themes repository and we have the same problem I spend some time looking at the documentation, issues, prs but nothing did the trick, then @sourcevault you are right BTW, you always are welcome to follow us on alacritty-themes😆 |
Beta Was this translation helpful? Give feedback.
-
@eemeli When I use String() or toString() the YAML comes out in a format that I can't seem to change—curly braces and double quotation marks, resembling JSON, like this:
Whereas the YAML.stringify function returns something that looks like this:
Is there a configuration I'm missing (I've tried simpleKeys and versions 1.0-2) to get that format from toString (so I can keep the anchors)? |
Beta Was this translation helpful? Give feedback.
-
I upgraded to 2.0 and it seems to be working now, although I can't figure out how to find the list of anchors in 2.0. In 1.10.0 the Document had an anchors property. In the documentation for 2.0 the "working with anchors" section linked in the table of contents is missing… is 2.0 a beta? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to preserve YAML anchor ? when using
.stringify
? after making some changes usingyaml.parseDocument
.Beta Was this translation helpful? Give feedback.
All reactions