Skip to content

A /* */ comment prevents a jsx element from being recognized #157

@mgedmin

Description

@mgedmin

I have code like this:

const renderThing = props => (
  /* Render a thing */
  <div>
    <span>
      {props.a_thing}
    </span>
  </div>
);

The <div> does not get highlighted as JSX (it's showing as jsIdentifier), the <span>...</span> is all right, and the </div> is treated as an < operator followed by an unterminated regexp literal /div>, which then renders the ) on the next line as an error (jsRegexpError).

Removing the /* Render a thing */ comment fixes highlighting. Replacing it with a // Render a thing comment also fixes highlighting.

I'm not sufficiently familiar with Vim syntax rules to figure out why this happens or how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions