language-javascript-jsx icon indicating copy to clipboard operation
language-javascript-jsx copied to clipboard

Strange Alternating Highlighting

Open damassi opened this issue 9 years ago • 4 comments

See below:

screen shot 2015-11-10 at 10 38 36 pm

damassi avatar Nov 11 '15 06:11 damassi

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.

subtleGradient avatar Nov 11 '15 10:11 subtleGradient

I get some weird highlighting sometimes as well. Certain keywords remain white while other times they are properly colours. Frustrating, I have to admit.

adamkdean avatar Nov 14 '15 16:11 adamkdean

I'm using Oceanic and the break occurs when i break my <JSX /> component props out onto their own lines.

damassi avatar Nov 15 '15 00:11 damassi

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.

screen shot 2016-08-24 at 3 07 22 pm

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.

ryaninvents avatar Aug 24 '16 18:08 ryaninvents