asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

Links don't work properly

Open rschuetzler opened this issue 6 years ago • 6 comments

I might be doing something wrong, but here's an example of a link in one of my documents:

* https://jvns.ca/networking-zine.pdf[Networking, Ack! Zine]

In the Asciidoc output it works fine, but inside the document when editing, the link becomes (https://jvns.ca/networking-zine.pdf[Networking), so if I click the link to visit a site, I get an error because [Networking is not a part of the URL.

rschuetzler avatar Jul 23 '18 20:07 rschuetzler

Hi @rschuetzler ,

It's a long time since the issue was opened. I can't reproduce it. Can you test if the issue continues in the last version?

FatihBozik avatar Oct 20 '19 13:10 FatihBozik

I can reproduce it with v2.7.6 and the following environment:

Version: 1.39.2 (user setup) Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390 Date: 2019-10-15T15:35:18.241Z Electron: 4.2.10 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.18362

anthonyvdotbe avatar Oct 20 '19 18:10 anthonyvdotbe

Ok. It's my fault. I can reproduce the issue when I try again.

FatihBozik avatar Oct 20 '19 18:10 FatihBozik

duplicate of #116

It's actually a vscode issue: microsoft/vscode#67022

sanzoghenzo avatar Feb 03 '20 10:02 sanzoghenzo

The recommendation is to fix this with a link provider for asciidoc filetype https://github.com/microsoft/vscode/issues/67022#issuecomment-459149908 .

https://code.visualstudio.com/api/references/vscode-api https://code.visualstudio.com/api/references/vscode-api#DocumentLinkProvider https://code.visualstudio.com/api/references/vscode-api#DocumentSelector

ieugen avatar Jan 03 '21 20:01 ieugen

We should also register a LinkProvider for include and xref file references.

danyill avatar Oct 20 '21 23:10 danyill

There's still a problem with detecting the end of URLs in the editor, is there a chance for further improvements? It would be good if further common scenarios could be handled such as when a URL is followed by punctuation (recognized as not being a part of the URL itself based on the following space). image

Oobiewan avatar Jan 08 '24 10:01 Oobiewan

Could you please copy/paste the text in your screenshot so we can add it in our test suite?

ggrossetie avatar Jan 08 '24 21:01 ggrossetie

Hi, here's the example:

You can refer to a URL such as https://github.com/asciidoctor/asciidoctor-vscode/, and continue the sentence or the paragraph. The end of the URL is never recognized therefore highlighting and Ctrl+click are broken. 

And I just came across another one where even the closing square bracket is not recognized as the end of the link:

Filters are created as RPN filters (Reverse Polish notation [https://wikipedia.org/wiki/Reverse_Polish_notation]) with the following syntax:

image

Oobiewan avatar Jan 09 '24 15:01 Oobiewan