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

CS2 Discussion: Features: Allow backticks to be used inside embedded Javascript blocks #4938

Closed
coffeescriptbot opened this issue Feb 19, 2018 · 1 comment

Comments

@coffeescriptbot
Copy link
Collaborator

From @greghuc on 2016-09-20 18:16

As discussed here, I'm splitting out a separate issue for allowing backticks to be used inside embedded Javascript blocks.

This is a straight-up bug fix for an issue that has been around since 2011, but has become more important since the introduction of ES6 template literals.

ES6 template literals cannot be used in an embedded Javascript block, since the new syntax uses backticks. Backticks are already used by Coffeescript to define the start and end of the JS block. This example blows up:

`3 + 2 = ${3 + 2}`

The proposed fix is for Coffeescript to allow embedded Javascript blocks to be delineated with 3-backticks markdown-style, and not escape backticks in the Javascript block. E.g.:

    ```
    `3 + 2 = ${3 + 2}`
    ```

Reasoning:

@coffeescriptbot
Copy link
Collaborator Author

From @GeoffreyBooth on 2016-12-05 01:56

Released in CoffeeScript 1.12.0.

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

No branches or pull requests

1 participant