When encoding a string that:
- Requires escaping (e.g. contains a backslash)
- Starts with a single quote
…the stringifier emits a broken multiline token that cannot be parsed back.
Example input:
const Hjson = require('hjson');
const obj = {
"test": "'Hello,\\nWorld!'"
};
console.log(Hjson.stringify(obj));
Produces this broken output:
{
test: ''''Hello,\nWorld!''''
}
When encoding a string that:
…the stringifier emits a broken multiline token that cannot be parsed back.
Example input:
Produces this broken output: