-
-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
A string value which can be recognized a numeric or boolean value by the default schema s emitted with suttounding double-quotes.
To Reproduce
Create a document with a node with explicit 'PLAIN' type and stringify the document :
const yamlDoc = new YAML.Document();
const rootNode = new YAML.YAMLMap();
const hexNode = new YAML.Scalar('0x002A');
hexNode.type = Scalar.PLAIN;
rootNode.set('hex', hexNode);
const output = yamlDoc.toString();
The output string contains value surrounded by double quotes:
hex: "0x002A"
Expected behaviour
The output string should use plain string:
hex: 0x002A
Versions (please complete the following information):
- Environment: Node.js v20.11.1
yaml
: 2.7.1
Additional context
Unfortunately this incorrect behavior is even demonstrated by the regression tests for custom tags:
(tests/doc/types.ts:908)
The input is correctly parsed, but emitter output is not equal to the input: double quotes are added around values
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working