Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

wrong highlighting for words that starts with "constructor" #391

Closed
peonmodel opened this issue Aug 4, 2016 · 3 comments
Closed

wrong highlighting for words that starts with "constructor" #391

peonmodel opened this issue Aug 4, 2016 · 3 comments
Labels

Comments

@peonmodel
Copy link

peonmodel commented Aug 4, 2016

currently at version 1.9.1

if a key starts with "constructor", only "constructor" will be highlighted as different color, also screw up highlighting for other keys in the object

Using the Base16 Tomorrow Dark theme (bug is independent of theme)

a = {
  constructorExtension: {  // result will be <blue>constructor</blue>Extension
    keys: {},  // keys will be white
    'morekeys': {},  // 'morekeys' will be white when it is usually green
    someFn: function(){},  // someFn is usually blue, but is now white
    'otherFn': function(){},  // the quotes are supposed to be green and otherFn blue, but is all white
  },
};

compare against

b = {
  construXXXXctorExtension: {  // bug do not occur if construXXXXctor
    keys: {},  
    'morekeys': {},  
    someFn: function(){},  
    'otherFn': function(){}, 
  },
};
@winstliu
Copy link
Contributor

winstliu commented Aug 4, 2016

Thanks for the report @peonmodel!

In the future if you want to automatically syntax highlight code blocks on GitHub, simply add the language next to the three backticks like so: ```js

@NatalieWolfe
Copy link

NatalieWolfe commented Aug 8, 2016

Relatedly, this also messes up object literals when constructor is by itself.

var foo = {
  constructor: 'Foo',
  bar: 'fizz'
}

Vs

var foo = {
  construXXXXctor: 'Foo',
  bar: 'fizz'
}

@winstliu
Copy link
Contributor

winstliu commented Aug 9, 2016

@NatalieWolfe That's a different bug: #334

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants