-
-
Notifications
You must be signed in to change notification settings - Fork 13
Description
-
What's the output of
git remote get-url origin?It's
https://github.com/linrongbin16/gitlinker.nvim.git -
what's the expect git host url you want to generate?
It's
https://github.com/linrongbin16/gitlinker.nvim/blob/d2a250e65207ddc04724579b99e564da01922a65/README.md?plain=1#L1
but was
https://github.com/linrongbin16/gitlinker.nvim/blob/d2a250e65207ddc04724579b99e564da01922a65/README.md?plain=1?plain=1#L1 -
how do you configure this plugin?
It's ...
{
"linrongbin16/gitlinker.nvim",
cmd = "GitLink",
opts = function ()
return {
router = {
browse = {
["my.custom.github.enterprise.host.example.com"] = require('gitlinker.routers').github_browse,
-- The default router for github.com works correctly.
-- The following line intentionally assigns the github_browse router
-- to github.com in order to reproduce this bug.
["^github.com"] = require('gitlinker.routers').github_browse,
}
}
}
end,
},(This issue occurs with GitHub Enterprise, but can be reproduced on github.com by intentionally assigning the github_browse router.)
-
What's your OS and Neovim version?
The OS is: Manjaro x86_64 (Intel chip), MacOS M1 chip
The Neovim version (
nvim --version) is: ...
NVIM v0.11.5
Build type: RelWithDebInfo
LuaJIT 2.1.1753364724
Description
When generating a link for a Markdown file with GitHub Enterprise, ?plain=1 is incorrectly appended twice to the URL. As a result, the generated URL is
- unable to open a link in plain mode.
- not replaced with a code preview when pasted in issue/PR comments.
Example:
https://github.com/linrongbin16/gitlinker.nvim/blob/d2a250e65207ddc04724579b99e564da01922a65/README.md?plain=1#L1
Line 1 in d2a250e
# gitlinker.nvim https://github.com/linrongbin16/gitlinker.nvim/blob/d2a250e65207ddc04724579b99e564da01922a65/README.md?plain=1?plain=1#L1
https://github.com/linrongbin16/gitlinker.nvim/blob/d2a250e65207ddc04724579b99e564da01922a65/README.md?plain=1?plain=1#L1
It seems this issue is specific to Markdown files.
Repro
- Clone
https://github.com/linrongbin16/gitlinker.nvim.gitand open README.md. - Run
:GitLinkwith the above config. - The generated URL contains the duplicated
?plain=1.