jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-line string throwing "Malformed YAML string" error

brendon-stephens opened this issue · comments

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
}