Skip to content

Multi-line string throwing "Malformed YAML string" error #141

@brendon-stephens

Description

@brendon-stephens

Given the following valid YAML file

test.yaml

test: "ThisIsAVery\
  LargeString\
  WhichNeedsToBe\
  SeperatedOver\
  MultipleLines\
  WithoutSpaces"

and the following javascript

test.js

const YAML = require('yamljs')

const yaml = YAML.load('test.yaml')
console.log(yaml)

Throws the following error

$ node test.js

C:\Apps\Projects\Sandbox\node_modules\yamljs\lib\Parser.js:404
            throw e;
            ^
[ParseMore [Error]: Malformed inline YAML string ("ThisIsAVery\
LargeString\
WhichNeedsToBe\
SeperatedOver\
MultipleLines\
WithoutSpaces").] {
  parsedLine: ←[33m6←[39m,
  snippet: ←[32m'    WithoutSpaces"'←[39m
}

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