atom / language-coffee-script

CoffeeScript support in Atom
Other
59 stars 56 forks source link

Handle string quotes in JSX #174

Open edemaine opened 3 years ago

edemaine commented 3 years ago

Prerequisites

Description

String quotes should not be processed when inside JSX (HTML) blocks.

Steps to Reproduce

  1. Create a file test.coffee
  2. Type the following file content:

    <code>
     Hello world's
     this is some {'text'}
    </code>

Expected behavior:

This is the highlighting I expect, which is what I get when using JavaScript highlighting (.jsx extension):

image

Actual behavior:

This is the highlighting I get:

image

Reproduces how often:

100%

Versions

1.54.0 x64 on Windows 10

I originally observed this issue in vscode (see https://github.com/microsoft/vscode/issues/117143).

Additional Information

I'm new to these JSON syntax files, but given that it works in JavaScript, I imagine it is possible (and hopefully easy?) to fix.

Related issue: #135. But I think that should be closed, because #172 merged.

edemaine commented 2 years ago

I just noticed https://github.com/crisward/cjsx which might be an approach to solving this issue.