jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to change string quoting character in stringify()?

crystalfp opened this issue · comments

In Italian the single quote character is commonly used as apostrophe. The quoting needed and enforced by the single quote choice for strings, in my opinion makes unnecessary complex the result of stringify(). An example: YAML.stringify({testo: "dell'acqua"}) -> testo: 'dell''acqua'
Why don't make it testo: "dell'acqua"?

Seems that the only workaround I have is to use the utf8 apostrophe (’). Using it I have:
YAML.stringify({testo: "dell’acqua"}) -> testo: dell’acqua Much simpler.

Thanks for considering!
mario