Skip to content
This repository was archived by the owner on Oct 27, 2019. It is now read-only.
This repository was archived by the owner on Oct 27, 2019. It is now read-only.

Code coloring problem with a RegExp ending with a / after an || #34

Description

@erikras

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}`)

regexp

Interestingly, if you remove the !url || before the RegExp, it works fine. Something about the || is throwing it off.

More info: facebookarchive/nuclide#1121

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions