Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extra new line added #221

Description

@IvanGoncharov

Test:

var YAML = require('js-yaml');

data = "test1\ntest2"
console.log(data);
console.log('===============================================================');
data = YAML.safeDump(data);
console.log(data);
console.log('===============================================================');
data = YAML.safeLoad(data);
console.log(data);
console.log('===============================================================');

Output:

$ node test.js 
test1
test2
===============================================================
|-
test1
test2

===============================================================
test1
test2

===============================================================

So extra new line added in the end of string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions