Remove angle brackets when checking the scheme#133419
Merged
mjbvz merged 2 commits intomicrosoft:mainfrom Oct 4, 2021
Merged
Conversation
This only removes the brackets during the scheme check if the initial link provided actually has angle brackets.
mjbvz
requested changes
Sep 27, 2021
Collaborator
mjbvz
left a comment
There was a problem hiding this comment.
Thanks for taking a look. Just a few minor points of feedback
Change to use replace instead of match for easier reading
Contributor
Author
|
@mjbvz I made those changes you suggested, and thank you for reviewing the PR. Let me know of any further changes you may think of. |
Collaborator
|
Thanks! |
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.
Summary
When the link is being checked for a known scheme in a markdown file, the scheme wasn't being recognized when encased inside of angle brackets < and >. This change strips the link of beginning and ending < and > so the scheme can be properly checked.
This only removes the brackets during the scheme check if the initial link provided actually has angle brackets. Otherwise it will just use the given link as usual.
Issue
This PR fixes #132974
Testing (Currently Released Build)
Begin editing a markdown file, and enter the following text into the file. If you attempt to
command + clickorcontrol + clickthe link in the markdown file you are editing, it won't open in a browser. (note it will open from the markdown preview, just not the editable markdown file)Testing (Fixes)
With the code changes applied, you can enter the same text in a markdown file, and the link will open up as expected in the browser. (and it will still open from the markdown preview).