asciidoctor-vscode
asciidoctor-vscode copied to clipboard
Links don't work properly
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.
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?
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
Ok. It's my fault. I can reproduce the issue when I try again.
duplicate of #116
It's actually a vscode issue: microsoft/vscode#67022
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
We should also register a LinkProvider for include
and xref
file references.
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).
Could you please copy/paste the text in your screenshot so we can add it in our test suite?
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: