You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dumping add quote to string even it is not necessary #470
Activity
diberry commentedon Feb 26, 2019
This is the same as #466. Perhaps we can have a new setting to handle the quoting issue?
puzrin commentedon Feb 26, 2019
@joshuaavalon "unquoting" quality is limited only by authors time. If anyone has time to improve it - PR is welcome.
diberry commentedon Feb 26, 2019
@puzrin I'll make a PR this weekend, if no one does it before then.
diberry commentedon Mar 2, 2019
PR 454 seems related
diberry commentedon Mar 3, 2019
@puzrin Are these tests all valid/correct?
`test.only('should not unnecessaryly apply quotes', function () {
var expected = 'url: https://github.com/nodeca/js-yaml\n';
var actual = yaml.dump({ url: 'https://github.com/nodeca/js-yaml' });
assert.strictEqual(actual, expected);
});
test.only('should not unnecessaryly apply quotes - ', function () {
var expected = 'url: https://github.com/nodeca/js-yaml\n';
var obj = {};
obj['url']='https://github.com/nodeca/js-yaml';
var actual = yaml.dump(obj);
assert.strictEqual(actual, expected);
});
test.only('should not unnecessaryly apply quotes - space then /\n at end of value', function () {
var expected = 'url: 'https://github.com/nodeca/js-yaml '\n';
var obj = {};
obj['url']='https://github.com/nodeca/js-yaml ';
var actual = yaml.dump(obj);
assert.strictEqual(actual, expected);
});
test.only('should not unnecessaryly apply quotes - space after colon', function () {
var expected = 'url: 'https: //github.com/nodeca/js-yaml'\n';
var actual = yaml.dump({ url: 'https: //github.com/nodeca/js-yaml' });
assert.strictEqual(actual, expected);
});
`
puzrin commentedon Mar 3, 2019
Could you format you message and add proper lang type for highlight?
spelling correction for nodeca#470 test descriptions
extended tests for nodeca#470, including bugfix for the dumper: now a…
extended tests for nodeca#470, including bugfix for the dumper: now a…
spelling correction for nodeca#470 test descriptions
Revert nodeca#470/nodeca#473 for dumper: too many situations where th…
fixups following the nodeca#470/nodeca#473 revert action.
kchen-shanghai commentedon Jul 2, 2020
Having a same problem here. Since only colon and hash characters are limited in flow scalars, is a PR still welcome by now?
Giszmo commentedon Jul 22, 2020
@ZEROPC I would appreciate a fix but but not speaking for the project. Crossing fingers :D
Don't quote literals with `:` except when necessary
Don't quote literals with `:` except when necessary
rlidwka commentedon Dec 10, 2020
Fixed in db3f529 (in dev branch currently, to be released later).
mgiamberardino commentedon Dec 16, 2020
I'm experiencing a related issue but not entirely sure is the same one.
We have some cases where the object is like:
{ "CC#": "some data" }And right now this is being confused with a comment in the library. Is this fix related or should I create a new issue?
rlidwka commentedon Dec 25, 2020
This fix is not related, so it's a new issue.
But I'm not entirely sure what you're talking about.
#symbol is required to have a space/tab/newline before it to be a comment.If you just put
CC#, it's not parsed as a comment: