Skip to content

Heuristics when datafiles uses block scalar headers (aka | ) for string or direct (quoted) #400

@seichter

Description

@seichter

Not really a bug report, rather a request for clarification because the documentation doesn't cover this.

When storing some longer strings (actually some markdown snippets) I found that these will be stored in YAML with the block scalar header. However, it somehow also included a block chomping indicator.

literature: |-
  Den Studierenden ....

in other parts it uses raw strings.

desc: "Die Studierenden sollen ... "

So, both have their reasons. However, it would be great to know the underlying heuristics when what is being used. Or, even better the type-annotation is extended to include instructions on how to serialize the strings.

It would be great if this could be clarified or documented somehow.

[UPDATE]

To clarify: this behavior only happens when datafile writes data into an existing YAML file where the block scalar header already exists for this item.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions