I need to do something like the following:
description: |-
#This is not a comment#
Some more text.
But of course the first line is interpreted as a comment by the yaml parser. I cannot use double quotes here since I need this to be multiline.
What can I do to achieve this?
Thanks.
It should work the way you have it if you really have it indented properly which it seems that you do. So maybe it is a bug in your parser.
It seems to work with SnakeYAML - copy pasting your snippet to http://instantyaml.appspot.com/ returns:
%YAML 1.1
---
!!map {
? !!str "description"
: !!str "#This is not a comment#\nSome more text.",
}
...
Which is essentially the same as when you try the same example without hashes:
%YAML 1.1
---
!!map {
? !!str "description"
: !!str "This is not a comment\nSome more text.",
}
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With