[PR #4192] [MERGED] HTML-escape plain-text READMEs in previews #17276

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

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/4192
Author: @antiprime
Created: 6/8/2018
Status: Merged
Merged: 6/10/2018
Merged by: @lafriks

Base: masterHead: escape-readme


📝 Commits (3)

  • 1e23ee1 HTML-escape text READMEs
  • 0ccae19 Merge branch 'master' into escape-readme
  • 8eaca6d Merge branch 'master' into escape-readme

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 routers/repo/view.go (+6 -2)

📄 Description

Previews of plain-text README files are not currently HTML-escaped; this causes issues when READMEs contain characters like < and >, including constructs like Copyright 2018 Example <me@example.com>, which currently renders as Copyright 2018 Example.

This PR ensures that plain-text READMEs are HTML-escaped.


🔄 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/4192 **Author:** [@antiprime](https://github.com/antiprime) **Created:** 6/8/2018 **Status:** ✅ Merged **Merged:** 6/10/2018 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `escape-readme` --- ### 📝 Commits (3) - [`1e23ee1`](https://github.com/go-gitea/gitea/commit/1e23ee1c80e82bc2dd63372297b2678a658a9594) HTML-escape text READMEs - [`0ccae19`](https://github.com/go-gitea/gitea/commit/0ccae197db26a6e607170be77a28864bdb3bd2d1) Merge branch 'master' into escape-readme - [`8eaca6d`](https://github.com/go-gitea/gitea/commit/8eaca6da924bbad531efffe3c97ad7a6873e8f79) Merge branch 'master' into escape-readme ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `routers/repo/view.go` (+6 -2) </details> ### 📄 Description Previews of plain-text README files are not currently HTML-escaped; this causes issues when READMEs contain characters like `<` and `>`, including constructs like `Copyright 2018 Example <me@example.com>`, which currently renders as `Copyright 2018 Example`. This PR ensures that plain-text READMEs are HTML-escaped. --- <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:31:28 -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#17276