#164 Wiki namespace issue

Open
opened 9 months ago by pgimeno · 3 comments

Adding a link like this in the wiki:

[Text](Pagename)

creates a link to:

https://notabug.org/USER/PROJECT/Pagename

I expected the link to point to:

https://notabug.org/USER/PROJECT/wiki/Pagename

See for example: https://notabug.org/pgimeno/digiplay/wiki to see the issue.

Adding a link like this in the wiki: ```md [Text](Pagename) ``` creates a link to: ```md https://notabug.org/USER/PROJECT/Pagename ``` I expected the link to point to: ```md https://notabug.org/USER/PROJECT/wiki/Pagename ``` See for example: https://notabug.org/pgimeno/digiplay/wiki to see the issue.
Pedro Gimeno commented 9 months ago
Poster

I don't know Go, and I'm unfamiliar with the structure of Gogs. I haven't even tried to compile this, but I wonder if the solution is something like:

--- a/routes/repo/wiki.go
+++ b/routes/repo/wiki.go
@@ -106,7 +106,7 @@ func renderWikiPage(c *context.Context, isViewPage bool) (*git.Repository, strin
                return nil, ""
        }
        if isViewPage {
-               c.Data["content"] = string(markup.Markdown(data, c.Repo.RepoLink, c.Repo.Repository.ComposeMetas()))
+               c.Data["content"] = string(markup.Markdown(data, c.Repo.RepoLink + "/wiki", c.Repo.Repository.ComposeMetas()))
        } else {
                c.Data["content"] = string(data)
        }
I don't know Go, and I'm unfamiliar with the structure of Gogs. I haven't even tried to compile this, but I wonder if the solution is something like: ```diff --- a/routes/repo/wiki.go +++ b/routes/repo/wiki.go @@ -106,7 +106,7 @@ func renderWikiPage(c *context.Context, isViewPage bool) (*git.Repository, strin return nil, "" } if isViewPage { - c.Data["content"] = string(markup.Markdown(data, c.Repo.RepoLink, c.Repo.Repository.ComposeMetas())) + c.Data["content"] = string(markup.Markdown(data, c.Repo.RepoLink + "/wiki", c.Repo.Repository.ComposeMetas())) } else { c.Data["content"] = string(data) } ```
Pedro Gimeno commented 9 months ago
Poster

This looks like upstream bug 2851. I've submitted the patch there too for consideration. EDIT: Or more like 2080 actually.

This looks like upstream bug [2851](https://github.com/gogs/gogs/issues/2851). I've submitted the patch there too for consideration. EDIT: Or more like [2080](https://github.com/gogs/gogs/issues/2080) actually.

try it yourself at the gogs demo site try.gogs.io - it the same bug is present there then notabug is probably not going to fix it - it should be fixed in gogs

anything non-odious that makes it into the upstream gogs will be merged into notabug eventually

try it yourself at the gogs demo site try.gogs.io - it the same bug is present there then notabug is probably not going to fix it - it should be fixed in gogs anything non-odious that makes it into the upstream gogs will be merged into notabug eventually
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.