new line "\n" in yaml file
31,676
try this
test: |+
This is a long string
with new lines
| after the key helps in beginning of multiline text indented and maintain the indentation for the long string.
![montrealmike](https://i.stack.imgur.com/tX9K1.jpg?s=256&g=1)
Comments
-
montrealmike almost 2 years
I'd like to do this
test: > This is a long string \n\n\n with new lines
But it prints out the "\n" instead of making new lines.
I know it's possible to do
test: "This is a long string \n\n\n with new lines"
But i'd rather not add quotes everywhere if possible. Thanks for the help!
EDIT: I'd rather not use empty lines. In other words, i'd like to use \n to show empty lines to make my yml file more readable.
-
montrealmike almost 12 yearsi'd like to use the \n notation instead of using empty lines (just for readability). Is there another way using the \n char?
-
abhas almost 12 yearsthen you have to use the qoutes...other solution i don't have any idea
-
abhas almost 12 yearsmore you can get here yaml.org/YAML_for_ruby.html#three_trailing_newlines_in_literals