Skip to content

Indicator character emitted as plain scalar unexpectedly #309

@PIG208

Description

@PIG208

When doing something like this:

ryml::Tree tree;
ryml::NodeRef wroot = tree.rootref();
wroot |= ryml::MAP;
wroot["name"] << "@test";
ryml::emit_yaml(wroot, stdout)

The output is

name: @test

while it is expected to be

name: '@test'

since "reserved indicators can't start a plain scalar."

I'm aware that ryml tends to be more permissive but in this case the generated output
cannot be parsed by other standard compliant parsers.

Reference: https://yaml.org/spec/1.2.2/#57-escaped-characters, example 5.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions