Code coloring problem with a RegExp ending with a / after an ||
erikras opened this issue · 0 comments
erikras commented
The javascript coloring is being thrown off by an escaped / at the end of a regular expression.
const addProtocol = (url: string): string =>
(!url || /^https?:\/\//.test(url) ? url : `http://${url}`)Interestingly, if you remove the !url || before the RegExp, it works fine. Something about the || is throwing it off.
More info: facebookarchive/nuclide#1121
