[PR #2292] [MERGED] Fix rendering of external links #16327

Closed
opened 2025-11-02 12:07:53 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2292
Author: @ethantkoenig
Created: 8/11/2017
Status: Merged
Merged: 8/13/2017
Merged by: @andreynering

Base: masterHead: fix/render_link


📝 Commits (1)

  • 299270a Fix rendering of external links

📊 Changes

4 files changed (+56 additions, -79 deletions)

View changed files

📝 modules/markdown/markdown.go (+28 -26)
📝 modules/markdown/markdown_test.go (+26 -52)
📝 routers/api/v1/misc/markdown_test.go (+1 -1)
📝 routers/init.go (+1 -0)

📄 Description

Fixes #2282 (both space-consuming bug and rendering-external-link-as-internal-issue bug).

Some minor points:

  • Now we only match URLs of the form {Setting.AppURL}/:owner/:repo/(issues|pulls)/:index
  • We previously appended <i class="icon comment"></i> to the displayed text for links to comments. However, due to client-side JS, the icon was never rendered. Ideally, I think we should append (comment) like Github does. However, adding this would require some extra refactoring (to support multiple languages), so I put it in a TODO

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2292 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 8/11/2017 **Status:** ✅ Merged **Merged:** 8/13/2017 **Merged by:** [@andreynering](https://github.com/andreynering) **Base:** `master` ← **Head:** `fix/render_link` --- ### 📝 Commits (1) - [`299270a`](https://github.com/go-gitea/gitea/commit/299270afe76027706bc60ae0e657db7ceacb749c) Fix rendering of external links ### 📊 Changes **4 files changed** (+56 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `modules/markdown/markdown.go` (+28 -26) 📝 `modules/markdown/markdown_test.go` (+26 -52) 📝 `routers/api/v1/misc/markdown_test.go` (+1 -1) 📝 `routers/init.go` (+1 -0) </details> ### 📄 Description Fixes #2282 (both space-consuming bug and rendering-external-link-as-internal-issue bug). Some minor points: - Now we only match URLs of the form `{Setting.AppURL}/:owner/:repo/(issues|pulls)/:index` - We previously appended ` <i class="icon comment"></i>` to the displayed text for links to comments. However, due to client-side JS, the icon was never rendered. Ideally, I think we should append ` (comment)` like Github does. However, adding this would require some extra refactoring (to support multiple languages), so I put it in a TODO --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:07:53 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16327