Non-SVG image links don't link to intended website #2122

Closed
opened 2025-11-02 04:24:45 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Eisfunke on GitHub (Jul 31, 2018).

  • Gitea version (or commit ref): Tested on 1.2.3 and 40bbc73
  • Operating system: Tested on Ubuntu 16.04.5 LTS and Arch Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    Seems down, so I can't check.

Description

When embedding an image with a link like this
[![test](https://img.shields.io/badge/test-yes-green.svg)](https://example.org)
in a markdown file in Gitea, it correctly shows as the image and links to the intended website.

Though when the linked image is not an svg, like this
[![test](https://img.shields.io/badge/test-no-red.png)](https://example.org)
it doesn't link to the intended website, but only to the image itself.

You can see it here: https://git.eisfunke.com/Eisfunke/test/src/branch/master/README.md

On Github it works: https://github.com/Eisfunke/test/blob/master/README.md

Originally created by @Eisfunke on GitHub (Jul 31, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): Tested on 1.2.3 and 40bbc73 - Operating system: Tested on Ubuntu 16.04.5 LTS and Arch Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: Seems down, so I can't check. ## Description When embedding an image with a link like this `[![test](https://img.shields.io/badge/test-yes-green.svg)](https://example.org)` in a markdown file in Gitea, it correctly shows as the image and links to the intended website. Though when the linked image is not an svg, like this `[![test](https://img.shields.io/badge/test-no-red.png)](https://example.org)` it doesn't link to the intended website, but only to the image itself. You can see it here: https://git.eisfunke.com/Eisfunke/test/src/branch/master/README.md On Github it works: https://github.com/Eisfunke/test/blob/master/README.md
GiteaMirror added the type/bug label 2025-11-02 04:24:45 -06:00
Author
Owner

@mappu commented on GitHub (Oct 6, 2018):

I can confirm this issue still affects 1.5.1.

Markdown content like [![](doc/image.thumb.png)](doc/image.png) creates a link to image.thumb.png, not image.png.

@mappu commented on GitHub (Oct 6, 2018): I can confirm this issue still affects 1.5.1. Markdown content like `[![](doc/image.thumb.png)](doc/image.png)` creates a link to `image.thumb.png`, not `image.png`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2122