sourcegraph / zoekt

Fast trigram based code search
Apache License 2.0
736 stars 83 forks source link

URLs for code links are escaping `+`s found in file paths #807

Closed rnc505 closed 1 month ago

rnc505 commented 3 months ago

What is the problem?

On the results page, if a search result contains a + in the file path, e.g. filename is SwiftFileName+SwiftCategoryName.swift, the URL escapes the + such that it breaks the link.

E.g. if the search result is expected to point to https://github.com/OrganizationName/RepositoryName/path/to/SwiftFileName+SwiftCategoryName.swift, the URL becomes https://github.com/OrganizationName/RepositoryName/path/to/SwiftFileName+SwiftCategoryName.swift, which leads to a broken page.

Why is this a problem?

Proposed fix

keegancsmith commented 3 months ago

Thanks for the report, should be an easy fix.

rnc505 commented 3 months ago

Awesome, thank you!

stephenlacy commented 1 month ago

Briefly looked into it, gets deeper into the weeds with https://github.com/golang/go/issues/42506

keegancsmith commented 1 month ago

I thought this would be easy to solve, but it ended up being a pretty deep change. Hopefully https://github.com/sourcegraph/zoekt/pull/843 resolves this for you.