Dumping add quote to string even it is not necessary
See original GitHub issueAs title.
Test Code
const jsYaml = require("js-yaml");
const fs = require("fs");
const yamlStr = jsYaml.dump({ url: "https://github.com/nodeca/js-yaml" });
fs.writeFileSync("foo.yml", yamlStr, { encoding: "utf8" });
Expected Result
url: https://github.com/nodeca/js-yaml
Actual Result
url: 'https://github.com/nodeca/js-yaml'
Problem
All of these characters ( except0xFEFF
) are safe inside string. Only colon cannot be followed by space or placed at the end of line.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (8 by maintainers)
Top Results From Across the Web
How to get raid of double quotes when dumping a string that ...
if a string to be dumped into a scalar has no special characters, but starts with a double quote, the whole scalar can...
Read more >Strings in YAML - To Quote or not to Quote | tinita [blogs.perl.org]
Another use case for quotes is when you have a string that would be resolved as a special type. This highly depends on...
Read more >Using quotation marks with strings in the AWS CLI
Using quotation marks around strings that contain white spaces. Parameter names and their values are separated by spaces on the command line.
Read more >Documentation: 15: pg_dump - PostgreSQL
Description. pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently....
Read more >mariadb-dump/mysqldump
It can be used to dump a database or a collection of databases for backup or transfer to another database server (not necessarily...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in https://github.com/nodeca/js-yaml/commit/db3f52985ba6f3076e6fb4318ca0c5c3c578ccba (in dev branch currently, to be released later).
Having a same problem here. Since only colon and hash characters are limited in flow scalars, is a PR still welcome by now?