dabbott / javascript-playgrounds

An interactive JavaScript sandbox
https://unpkg.com/javascript-playgrounds/public/index.html
Other
1.4k stars 131 forks source link

Syntax highlighting of first 'from' is wrong #21

Closed stevenreddie closed 6 years ago

stevenreddie commented 7 years ago

Hi, I noticed in Chrome (Mac; 57.0.2987.133) that http://dabbott.github.io/react-native-web-player/ and also the official Tutorial render the first 'from' below in black, whereas the second is light-blue:

import React, { Component } from 'react'
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} from 'react-native'

I can provide a screenshot if useful.

Thanks, Steven

dabbott commented 7 years ago

Thanks! This is due to the CodeMirror JS mode not recognizing syntax like import A, { B } from 'c'. I'm using an outdated fork of CodeMirror where I hackily added better ES6 and JSX support. Probably updating CodeMirror will solve this (presumably it's fully compatible with ES6 now)... although might make JSX support worse. Will just have to try it and see.

dabbott commented 6 years ago

I'm probably just not going to fix this, since it's pretty minor.