Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links doesn't work properly #116

Closed
john-cj opened this issue Oct 3, 2018 · 5 comments
Closed

Links doesn't work properly #116

john-cj opened this issue Oct 3, 2018 · 5 comments

Comments

@john-cj
Copy link

john-cj commented Oct 3, 2018

Example:

https://foo.bar/[this is foo site]

And here is how it will look inside VS Code:

bug

As you see, the syntax highlighting isn't correct. Aslo, if you click this link, it will open incorrect address:

https://foo.bar/[this
@john-cj john-cj closed this as completed Oct 7, 2018
@john-cj john-cj reopened this Jan 7, 2019
@MatteoCampinoti94
Copy link
Member

MatteoCampinoti94 commented Jan 7, 2019

It's not caused by the extension, the error is in VSCode's uri recognition. You can test it by putting the same link into a new blank file (CTRL+N).

VSCode seems to recognize as link any uri identifier (file:, http:, etc...) followed by any non-space characters. Something like this I guess: (https?|file)://\S+

@john-cj
Copy link
Author

john-cj commented Jan 7, 2019

@MatteoCampinoti94 Well, thank you. In this case I will post it in VS Code repository itself.

@MatteoCampinoti94
Copy link
Member

👍

@john-cj
Copy link
Author

john-cj commented Jan 23, 2019

microsoft/vscode#67022

@curiouslychase
Copy link

I was looking at the Sublime AsciiDoctor package (which is what I believe the current regex is "based off of") and the capture groups look different.

Submlime Regex: https://github.com/asciidoctor/sublimetext-asciidoc/blob/master/Syntaxes/Asciidoctor.tmLanguage#L1390-L1400

When I see links the highlighting captures everything to the apostrophe, including [, is it possible that the regex is greedily capturing incorrectly?

example in an asciidoc file:

- https://asciidoctor.org/docs/asciidoc-writers-guide/[AsciiDoc Writer's Guide]

image

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

No branches or pull requests

3 participants