Skip to content

" - |+ " and " - |" what is the difference #1876

Closed Answered by forgedhallpass
hktalent asked this question in Q&A
Discussion options

You must be logged in to vote

@hktalent

They are standard YAML syntax for working with multi-line strings.

Block scalars

Block style indicators

Indicates how newlines inside the block should behave

  • | (literal style): new lines are kept as new lines
  • > (folded style): new lines are replaced by spaces

Block chomping indicators

Controls what should happen with new lines at the end of a string

  • Default is no value (clip): adds a single new line at the end of the string
  • - (strip): removes all new line characters from the end of the string
  • + (keep): keeps all new lines at the end

TL;DR

" - |+ " and " - |" what is the difference

|+: keep all manually inserted new lines at the end of the string block
|: only one new line …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hktalent
Comment options

Comment options

You must be logged in to vote
1 reply
@hktalent
Comment options

Answer selected by hktalent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants