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

JSX Mode: incorrectly highlights inner content #5447

Closed
rubencarvalho opened this issue Jan 4, 2024 · 2 comments
Closed

JSX Mode: incorrectly highlights inner content #5447

rubencarvalho opened this issue Jan 4, 2024 · 2 comments

Comments

@rubencarvalho
Copy link

rubencarvalho commented Jan 4, 2024

Describe the bug

JSX code is incorrectly highlighted (the element's inner content is being tokenised).

Screenshot 2024-01-04 at 10 57 57

Expected Behavior

None of the words in the inner content of the elements should be highlighted.
GitHub's JSX syntax highlighting shows it best:

import * as React from "react";
export default () => {
  return (
    <div variant="p">
      When you launch an instance, the instance class that
      you specify determines the hardware of the host
      computer used for your instance. Each instance class
      offers different compute, memory, and storage
      capabilities. Choose an instance class based on the
      requirements of the application or software that you
      plan to run on your instance.
    </div>
  );
}

Reproduction Steps

  1. Go to https://ace.c9.io/build/kitchen-sink.html
  2. Set the mode to JSX
  3. Delete the document's contents
  4. Paste the following:
import * as React from "react";
export default () => {
  return (
    <div variant="p">
      When you launch an instance, the instance class that
      you specify determines the hardware of the host
      computer used for your instance. Each instance class
      offers different compute, memory, and storage
      capabilities. Choose an instance class based on the
      requirements of the application or software that you
      plan to run on your instance.
    </div>
  );
}

Possible Solution

Fix the JSX highlighting rules.

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

Ace Version 1.32.3 (latest)

@InspiredGuy
Copy link
Contributor

Hey, thank you for the report. This doesn't look nice indeed. You could try to substitute JSX mode for TSX while we look into it.

@InspiredGuy
Copy link
Contributor

#5451 with a fix for this issue was merged and will be available in the next release.

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