Improve REPL link highlight regexp#15406
Merged
isidorn merged 1 commit intomicrosoft:masterfrom Nov 14, 2016
Merged
Conversation
* Require terminators at start/end * Don't allow spaces in first path component of relative path * Don't capture root path component
|
@felixfbecker, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma, @bpasero and @isidorn to be potential reviewers. |
Collaborator
|
Looks good, same as previous PR let's merge this in and we see how it behaves on insider. As for how to get the aboslute path I believe Ben replied to you here #15174 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the issues I discovered after #15174 was merged.
#15174 added the ability to match relative paths by making the "root" path component optional. Unfortunately, since paths can contain spaces, that meant there was no leading "terminator" for the path anymore, so all whitespace and "at" before a relative path matched too:
This is resolved by requiring terminators at the start and end, which are line start/end,
at, brackets or quotes.The capture group that previously captured the "root" path component is not captured anymore (it was not used) and can now either be a unix root slash, a window drive letter component OR the beginning of a relative path, which cannot contain spaces.
Known issues:
Cannot match a relative path where the first component contains a space, like this:
Seems impossible to me without using look-around assertions.
Relative paths still cannot be opened, need to be resolved to absolute, don't know how.
https://regex101.com/r/xkAp3A/1