Skip to content

markdown href relative link issue #33972

Closed
@jwestfall69

Description

@jwestfall69

Description

Hi

I have a markdown where I'm pointing at a large image that is relative to the markdown file. I'm displaying a scaled down version of the image and then have a href around it so the user can click on the image to get the full size version. To do this I'm using:

<a href="docs/images/gaiden_cpu_pcb_top.png"><img src="docs/images/gaiden_cpu_pcb_top.png" width="40%"></a>

The scaled down image shows correctly but the href url ends up being incorrect. The directory the markdown file is in is missing from the href url.

I put up a copy of my repo on the demo site so you can see the issue. The PCB images on the following page

https://demo.gitea.com/jwestfall69/mad/src/branch/main/machine/gaiden

Here is the same repo on github, where the href's are correct

https://github.com/jwestfall69/mad/tree/main/machine/gaiden

Gitea Version

Local gitea was 1.22.6, but still happens after upgrading to 1.23.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image

In the image the url at the top is https://demo.gitea.com/jwestfall69/mad/src/branch/main/machine/gaiden and at the bottom you can see the url it wants to go to if I click on the pcb image is https://demo.gitea.com/jwestfall69/mad/src/branch/main/machine/docs/images/gaiden_cpu_pcb_top.png, which is missing the gaiden directory the README.md is in.

Git Version

2.39.5

Operating System

Debian 12.8

How are you running Gitea?

I use your downloads for gitea and have it running as a systemd service on Debian 12.8.

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions