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

fix(url): fix url encoding issue #226

Merged
merged 16 commits into from
Mar 18, 2024
Merged

fix(url): fix url encoding issue #226

merged 16 commits into from
Mar 18, 2024

Conversation

linrongbin16
Copy link
Owner

@linrongbin16 linrongbin16 commented Mar 15, 2024

Fix #224 .

I add an example that a file path contains multiple whitespaces here:

This file path contains multiple whitespaces.

The thing is:

  1. The generated url is not encoded in URL format.
  2. If open this url (with GitLink!) in browser, the browser (for my, it's google chrome) will auto encode the url into URI format, so it's still working for a browser.

Regression Test

Platforms

  • windows
  • macOS
  • linux

Hosts

Functions

  • Use GitLink(!) to copy git link (or open in browser).
  • Use GitLink(!) blame to copy the /blame link (or open in browser).
  • Use GitLink(!) default_branch to open the /main//master link in browser (or open in browser).
  • Use GitLink(!) current_branch to open the current branch link in browser (or open in browser).
  • Copy git link in a symlink directory of git repo.
  • Copy git link in an un-pushed git branch, and receive an expected error.
  • Copy git link in a pushed git branch but edited file, and receive a warning says the git link could be wrong.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 77.61%. Comparing base (0ff97f4) to head (24569e9).

Files Patch % Lines
lua/gitlinker.lua 0.00% 2 Missing ⚠️
lua/gitlinker/linker.lua 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #226      +/-   ##
==========================================
+ Coverage   73.81%   77.61%   +3.79%     
==========================================
  Files           9        9              
  Lines         802      804       +2     
==========================================
+ Hits          592      624      +32     
+ Misses        210      180      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@linrongbin16 linrongbin16 changed the title fix(uri): encode generated uri test(url): test generated url been encoded in url format Mar 15, 2024
@linrongbin16 linrongbin16 changed the title test(url): test generated url been encoded in url format fix(url): fix url encoding issue Mar 18, 2024
@linrongbin16 linrongbin16 merged commit 4b80c8b into master Mar 18, 2024
9 checks passed
@linrongbin16 linrongbin16 deleted the docs-remote-parameter branch March 18, 2024 02:02
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

Successfully merging this pull request may close these issues.

Bug: Encode spaces in url
1 participant