Regression - 1.22 wiki links which contain dots point to "raw" media and only return plain text #13166

Closed
opened 2025-11-02 10:33:18 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @reimer-atb on GitHub (Jun 17, 2024).

Description

Steps to reproduce

  1. Create a wiki page with a hyphen - or a dot . in the name
  2. Link to that page from another wiki page

Result

Clicking on the link will only return a plain text representation of the linked wiki page's content.

Expected Result

The whole wiki page html should be returned

Additional info

This was working in gitea 1.21.8.

The auto-generated URLs for the wiki pages with a hyphen end in .- and the ones for wiki pages with a . contain the dot.

I assume that this change caused the problem.

Example project with wiki

https://demo.gitea.com/reimer-atb/test/wiki/Home

Example markdown with links that do not work

Welcome to the Wiki.

- [Test](Test) => works
- [Test with spaces](Test-with-spaces) => works
- [Test-with-hyphen](Test-with-hyphen.-) => does **not** work
- [Test+with+spaces+2024-06-17.-](Test+with+spaces+2024-06-17.-) => does **not** work
- [2024-06-17](2024-06-17.-) => does **not** work
- [17-06-2024](17-06-2024.-) => does **not** work
- [17.06.2024](17.06.2024) => does **not** work
- [06/17/2024](06%2F17%2F2024) => works
- [17/06/2024](17%2F06%2F2024) => works

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Tested on demo.gitea.com and on a private gitea 1.22.0 instance (no idea how that is run because it is provided by someone else).

Database

None

Originally created by @reimer-atb on GitHub (Jun 17, 2024). ### Description **Steps to reproduce** 1. Create a wiki page with a hyphen `-` or a dot `.` in the name 2. Link to that page from another wiki page **Result** Clicking on the link will only return a plain text representation of the linked wiki page's content. **Expected Result** The whole wiki page html should be returned **Additional info** This was working in gitea 1.21.8. The auto-generated URLs for the wiki pages with a hyphen end in `.-` and the ones for wiki pages with a `.` contain the dot. I assume that [this change](https://github.com/go-gitea/gitea/pull/30273) caused the problem. **Example project with wiki** https://demo.gitea.com/reimer-atb/test/wiki/Home **Example markdown with links that do not work** ``` Welcome to the Wiki. - [Test](Test) => works - [Test with spaces](Test-with-spaces) => works - [Test-with-hyphen](Test-with-hyphen.-) => does **not** work - [Test+with+spaces+2024-06-17.-](Test+with+spaces+2024-06-17.-) => does **not** work - [2024-06-17](2024-06-17.-) => does **not** work - [17-06-2024](17-06-2024.-) => does **not** work - [17.06.2024](17.06.2024) => does **not** work - [06/17/2024](06%2F17%2F2024) => works - [17/06/2024](17%2F06%2F2024) => works ``` ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Tested on demo.gitea.com and on a private gitea 1.22.0 instance (no idea how that is run because it is provided by someone else). ### Database None
GiteaMirror added the issue/confirmedissue/regressiontype/bug labels 2025-11-02 10:33:19 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jun 17, 2024):

-> Fix rendered wiki page link #31398

@wxiaoguang commented on GitHub (Jun 17, 2024): -> Fix rendered wiki page link #31398
Author
Owner

@reimer-atb commented on GitHub (Jul 18, 2024):

@wxiaoguang please re-open because this is not fixed completely yet. Links are still broken if a wiki page's title contains a dot ..

Example pages:

  • "Meeting 18.07.2024"
  • "main.go"

See https://demo.gitea.com/reimer-atb/test/wiki/Home

@reimer-atb commented on GitHub (Jul 18, 2024): @wxiaoguang please re-open because this is not fixed completely yet. Links are still broken if a wiki page's title contains a dot `.`. Example pages: - "Meeting 18.07.2024" - "main.go" See https://demo.gitea.com/reimer-atb/test/wiki/Home
Author
Owner

@wxiaoguang commented on GitHub (Jul 18, 2024):

There is still a regression, from "Use raw Wiki links for non-renderable Wiki files (#30273)"

30273 renders all links to raw by default.

ps: I don't have time to work on Gitea at the moment. So if anyone has interest, feel free to fix or revert.

@wxiaoguang commented on GitHub (Jul 18, 2024): There is still a regression, from "Use raw Wiki links for non-renderable Wiki files (#30273)" `30273` renders all links to `raw` by default. ps: I don't have time to work on Gitea at the moment. So if anyone has interest, feel free to fix or revert.
Author
Owner

@Zettat123 commented on GitHub (Aug 10, 2024):

I did some tests on GitHub.

The link in Home.md is

- [main.go](main.go)
  • If main.go.md and main.go both exist, the content of main.go.md will be rendered when clicking the link
  • Only main.go.md exists but no main.go, the same as above
  • Only main.go exists but no main.go.md, the plain text of main.go will be displayed
  • If neither main.go.md nor main.go exist, the page for creating a new wiki will be displayed

I think we can fix the issue like GitHub does. We can check if the corresponding .md file exists when rendering the link.
If the .md file does not exist, render the raw file link.

@Zettat123 commented on GitHub (Aug 10, 2024): I did some tests on GitHub. The link in `Home.md` is ``` - [main.go](main.go) ``` - If `main.go.md` and `main.go` both exist, the content of `main.go.md` will be rendered when clicking the link - Only `main.go.md` exists but no `main.go`, the same as above - Only `main.go` exists but no `main.go.md`, the plain text of `main.go` will be displayed - If neither `main.go.md` nor `main.go` exist, the page for creating a new wiki will be displayed I think we can fix the issue like GitHub does. We can check if the corresponding `.md` file exists when rendering the link. If the `.md` file does not exist, render the raw file link.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13166