Skip to content
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

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

Closed
yairlenga opened this issue Oct 9, 2021 · 1 comment
Closed

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

yairlenga opened this issue Oct 9, 2021 · 1 comment
Assignees

Comments

@yairlenga
Copy link

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.

@jordanbtucker
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants