Skip to content

Unexpected end of plain scalar while parsing string #84

@Proximyst

Description

@Proximyst

With the following document:

hello:
  world: this is a string
    --- still a string

and the reproduction code:

use saphyr::{LoadableYamlNode, Yaml};

fn main() {
    let documents = Yaml::load_from_str(include_str!("document.yaml"));
    println!("{:#?}", documents);
}

You get an error back:

Err(
    ScanError {
        mark: Marker {
            index: 37,
            line: 3,
            col: 4,
        },
        info: "unexpected end of plain scalar",
    },
)

Tools like yq parse this perfectly fine:

$ yq '.' src/document.yaml
hello:
  world: this is a string --- still a string

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