language-javascript-jsx
language-javascript-jsx copied to clipboard
Strange Alternating Highlighting
See below:

That's strange. What code is above that in your file? What code coloring theme are you using? On Wed, Nov 11, 2015 at 1:39 AM Christopher Pappas [email protected] wrote:
See below:
[image: screen shot 2015-11-10 at 10 38 36 pm] https://cloud.githubusercontent.com/assets/236943/11085485/cd72bbe4-87fb-11e5-8948-c41b8a7544e3.png
— Reply to this email directly or view it on GitHub https://github.com/subtleGradient/language-javascript-jsx/issues/19.
I get some weird highlighting sometimes as well. Certain keywords remain white while other times they are properly colours. Frustrating, I have to admit.
I'm using Oceanic and the break occurs when i break my <JSX /> component props out onto their own lines.
I'm running into the same issue. I believe (haven't dived into the code yet; this is a total guess) that it's seeing the slash and starting a regex.
Here's the code:
import React, { Component, PropTypes } from 'react';
import Foo from '../components/Foo';
export class TypeDropdown extends Component {
renderBar(bar) {
return Object.keys(bar).map((k) => (
<Foo.Bar
key={k}
label={bar[k].displayName}
/>
));
}
render() {
const { props: { bar = null } } = this;
if (!bar) {
return (
<span>Please wait...</span>
);
}
return <Foo children={this.renderBar(bar)}/>;
}
}
Changing Foo.Bar
to Foo
has no effect.
Using Solarized Light syntax theme.
EDIT: documented a further quirk, but it turned out I was using a different syntax highlighter by mistake.