Skip to content

Feature Request: Option to keep use |- while using forceQuotes #726

@rinsuki

Description

@rinsuki

personally I prefer to use quotes for string in YAML, rather than raw strings, to keep avoid confuses around number, like this:

app:
  version: 1.2.3 # => string
pg:
  version: 15.2 # => edited by human and now its number, but unexpected...

in js-yaml, this can be done with forceQuotes option for yaml.dump(), but this also disables |- syntax.

app:
  version: '1.2.3' # this is string, really clear
  startup: "#!/bin/bash\n# doing something\n# also doing something..." # ... hard to read

since | defines they are always string (like quotes does), it would be good to have option to also allow their (aka just simply disallows implicit string literal)

Expected Result:

app:
  version: '1.2.3'
  startup: |-
    #!/bin/bash
    # doing something
    # also doing something...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions