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

Parser removing "#" in multiline strings

evanreichard opened this issue · comments

The following:

item:
  1:
    - value: |
        ### Header

Results in:

{
  "item": {
    "1": [
      {
        "value": ""
      }
    ]
  }
}

When it should result in:

{
  "item": {
    "1": [
      {
        "value": "### Header"
      }
    ]
  }
}

@evanreichard

We have same issue.

This is mutation problem in cleanup function. He used the parameter as variable and return value in the function.
I tried to add new variable and used that as a return variable, it works but another problem pops out.

I switched over to using js-yaml due to this bug and it worked like a charm.