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

accept triple slash file URIs (file:///...) as valid links #391

Merged
merged 5 commits into from
Mar 29, 2024
Merged

accept triple slash file URIs (file:///...) as valid links #391

merged 5 commits into from
Mar 29, 2024

Conversation

tjex
Copy link
Member

@tjex tjex commented Feb 10, 2024

PR to fix #250. Links such as [title](file:///file.go) were returning an
lsp error "not found". The LSP does not actually check for the existence of
files via this format. Instead it was a symptom of the markdown link regex
checking, whereby the link was being understood as an internal markdown
document. Zk / lsp then tried to find the note file:///file.example, which it
if course couldn't, and so it was throwing the "not found" error.

This sollution copies the logic already present for embedded images, which is to
pick a defining syntactic element of the link (in this case, the third
occurrence of a '/' rune), and to skip that link with continue, effectively
ignoring it.

@tjex
Copy link
Member Author

tjex commented Feb 10, 2024

sorry for the formatting in the PR text... Its a gh cli thing cli/cli#7616

internal/adapter/lsp/document.go Outdated Show resolved Hide resolved
internal/adapter/lsp/document.go Outdated Show resolved Hide resolved
internal/adapter/lsp/document.go Outdated Show resolved Hide resolved
internal/adapter/lsp/document.go Show resolved Hide resolved
Copy link

This pull request has been automatically marked as stale because it has not had recent activity.

@github-actions github-actions bot added the stale No recent activity label Mar 16, 2024
@tjex tjex added bug Something isn't working and removed stale No recent activity labels Mar 16, 2024
@tjex tjex self-assigned this Mar 16, 2024
@tjex tjex requested a review from mcDevnagh March 21, 2024 02:46
@jurica jurica self-requested a review March 21, 2024 18:51
Copy link
Member

@jurica jurica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tjex
Copy link
Member Author

tjex commented Mar 24, 2024

@mcDevnagh are you around to approve your reviewed changes (merging is blocked until you review)? Otherwise I'll dismiss and ask someone else to approve (just feels rude to dismiss until I try to ping you here as well).

@mcDevnagh
Copy link
Contributor

I'll take a look

@tjex tjex dismissed mcDevnagh’s stale review March 29, 2024 03:27

seems that @mcDavenagh isn't available enough at the moment to re-review, and @jurica already reviewed

@tjex tjex requested a review from jurica March 29, 2024 03:27
@tjex
Copy link
Member Author

tjex commented Mar 29, 2024

Looks good to me.

@jurica , I think mcDevangh is a bit too snowed under to re-review. I've dismissed his review so that you can pass the review as well, incase he needs more time. Just caus I'd like to move on to tackling the other bugs this long weekend, which will be working in the same file as this PR.

@jurica jurica merged commit b10d51d into zk-org:main Mar 29, 2024
3 checks passed
@jurica
Copy link
Member

jurica commented Mar 29, 2024

Looks good to me.

@jurica , I think mcDevangh is a bit too snowed under to re-review. I've dismissed his review so that you can pass the review as well, incase he needs more time. Just caus I'd like to move on to tackling the other bugs this long weekend, which will be working in the same file as this PR.

Sure if it's holding you back from doing more. I didn't want to merge it right away last week to give others the chance to also review...

@mcDevnagh
Copy link
Contributor

sorry for dropping the ball on this one! Thank you @jurica for picking up my slack. For what it's worth, code looks good :)

@julio-lopez julio-lopez changed the title accept tripple dash file URIs as valid links accept triple slash file URIs (file:///...) as valid links May 31, 2024
@tjex tjex mentioned this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken file based url
3 participants