json5/json5-spec

Allow backquoted string (a.k.a., Template’s strings)

Closed this issue · 1 comments

Would like to suggest adding the back quote string (subset of ES6 template string) operator as an alternative to the single quote/double quote already supported.

see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

The main advantage is that template string will allow embedding multi-line string, without having to escape the new lines. This will allow embedding other text directly, instead of the tedious effort to escape the new lines at the end of every line.

to emphasize: I am not suggesting that to add support for interpolation, or any of the other features supported by template string in ESMA script. The syntax should match the template string as by link above.

Thank you for your suggestion. JSON5 adheres to the syntax of ECMAScript 5. This is to ensure long-term compatibility and also to avoid scope creep and bloat. If you would like to use template syntax with JSON-like formats, you can look into JSONext.