Skip to content

[writer] Implement full-weight scalar style resolver. #66

@dervus

Description

@dervus

It should resolve scalars to all available YAML scalar styles: plain, single-quoted, double-quoted, folded, and literal.

Examples:

text: Simple string.
text: 'String with trailing spaces...  '
text: "String with unprintable (\0, \uFFFE) characters."
text: "String with \"quotation\" 'mark' characters."
# Folded style: there is only one line break after the title.
text: >
  Multiline string.

  This is very a long
  text. It contains no
  line breaks. So it
  is better to use
  folded style here.
# Literal style: there is a line break after _each_ actual line.
text: |
  This text contains
  a lot of short lines.
  So, it is better to
  use literal style here.

Note. The actual resolver makes only rough choose between plain and double-quoted styles.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions