Skip to content
This repository has been archived by the owner on Feb 19, 2018. It is now read-only.

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

Closed
greghuc opened this issue Sep 20, 2016 · 2 comments

Comments

@greghuc
Copy link

greghuc commented Sep 20, 2016

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:

@GeoffreyBooth
Copy link
Collaborator

Released in CoffeeScript 1.12.0.

@coffeescriptbot coffeescriptbot changed the title Allow backticks to be used inside embedded Javascript blocks CS2 Discussion: Features: Allow backticks to be used inside embedded Javascript blocks Feb 19, 2018
@coffeescriptbot
Copy link
Collaborator

Migrated to jashkenas/coffeescript#4938

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

No branches or pull requests

3 participants