atom-react icon indicating copy to clipboard operation
atom-react copied to clipboard

Highlighting of comments is broken when code is dense

Open softwarecreations opened this issue 7 years ago • 0 comments

To reproduce, create a new file with highlighting orktes/atom-react "Javascript (JSX)" highlighting and paste this in:

const i = Math.random()*100;

//comment highlighted correctly

if (i< 40) console.log('foo');
//comment highlighted correctly

if (i<40) console.log('foo');
//comment highlighting broken because grammar file has bug thinking that <40 is the opening of a JSX tag.
//Silly because a JSX tag should not be openable with a number.

const test=20;
if (i<test) console.log('foo');
//another comment to test if the above line breaks highlighting after the fix.

Suggested simple solution JSX tags should only be openable if they are preceeded by \n or \s

softwarecreations avatar Aug 02 '17 07:08 softwarecreations