-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong quote position writing condensed flow #526
Comments
Dupe of #412 |
I made a simple bugfix for this, should i discard it or make a PR? |
I guess those options are mutually exclusive. |
When using
So either "condenseFlow" is useless or it's broken. There's something I'm misunderstanding? |
We do nod add features "just for fun". As i said, this option was introduced for concrete use case, and not expected to be used anyhow else. If you wish this to be changed - describe your use case first, before any coding. |
The use case I'm referring is URL encoding. The bug is in dumper.js, line 572, where comma is appended after the quote instead of before. I understand this library isn't intended to be used as minifier, so if this fix isn't well accepted I will not go further. |
Probably i missunderstood you. Take a look at https://github.com/nodeca/js-yaml/pull/358/files, there are some tests. If something is missed and works not as intended in original PR, fix will be accepted. Just make sure that's really a bug, because this option should be actively used by PR authors and they did not reported problem before. |
The original test doesn't throw error because it uses a collection with only one item, so no comma is written. I think this bug wasn't included in the original PR (#358), because code is much different from the current version. Maybe PR authors never upgraded to a newer version with the bug. I made a PR including the fix and an improvement to the original test to intercept the bug: #527 |
#### [\`v3.14.0\`](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md#3140---2020-05-22) ##### Changed - Support `safe/loadAll(input, options)` variant of call. - CI: drop outdated nodejs versions. - Dev deps bump. ##### Fixed - Quote `=` in plain scalars [#519](nodeca/js-yaml#519). - Check the node type for `!<?>` tag in case user manually specifies it. - Verify that there are no null-bytes in input. - Fix wrong quote position when writing condensed flow, [#526](nodeca/js-yaml#526).
##### [\`v3.14.0\`](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md#3140---2020-05-22) ##### Changed - Support `safe/loadAll(input, options)` variant of call. - CI: drop outdated nodejs versions. - Dev deps bump. ##### Fixed - Quote `=` in plain scalars [#519](nodeca/js-yaml#519). - Check the node type for `!<?>` tag in case user manually specifies it. - Verify that there are no null-bytes in input. - Fix wrong quote position when writing condensed flow, [#526](nodeca/js-yaml#526).
This document:
dumped with options
{ flowLevel: 0, condenseFlow: true }
produces output with misplaced quote:The text was updated successfully, but these errors were encountered: