codemirror5: Failing cases in JSX mode

Following up on: https://github.com/codemirror/CodeMirror/pull/3742

Three from the jsx/index.html page:

  1. Boolean attributes are not recognized properly (note the red self-closing />) screen shot 2015-12-29 at 9 41 02 am
  2. Block comments styled incorrectly (should be the brown comment color)
  3. Line comments are not recognized properly (note the red self-closing />) screen shot 2015-12-29 at 9 41 30 am

Two other things I’ve found:

4 . Elements should be allowed as attributes screen shot 2015-12-29 at 9 42 54 am

5 . Indentation in JS expressions should be relative to the indentation level of JSX elements. I believe currently they get indented to prior JS indentation level. (this issue is highest priority, if I had to choose)

Current behavior gif here: js-expression-indentation

Correct position here: screen shot 2015-12-29 at 10 05 11 am

Another example of current behavior (not followed by } char): js-indentation-2

Correct position here: screen shot 2015-12-29 at 10 08 29 am

@parisk @petetnt

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 21 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I don’t really understand why, if there’s already all this. I’m not saying the code should be physically copied, but enabling the Javascript syntax should IMO also enable JSX… especially if TypeScript and others are also already enabled.