#770·shiki

Using transformerNotationHighlight in JSX code

Author: YonomCreated Sep 5, 2024Updated May 15, 2026

Validations

Describe the bug

typescript
```ts
const Test: React.FC = () => {
  return (
    <div>
      <div /> {/* [!code highlight] */}
    </div>
  );
};
```

gets converted to

typescript
const Test: React.FC = () => {
  return (
    <div>
      <div /> {}
    </div>
  );
};

I expected no empty brackets {} to remain. I believe {/* comment */} is the only valid syntax for comments inside JSX.

Reproduction

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests