URL formatting breaks in PR comments due to hyphens in org or repo names #2391

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

Originally created by @Alofoxx on GitHub (Oct 9, 2018).

Description

URL formatting breaks in PR comments when there is a hyphen in the URL (as there would be in any repo name that contains a hyphen). I recreated the issue in your demo site.
https://try.gitea.io/alofoxx/testing-pr-comments/pulls/1#issuecomment-8069

The parsing seems to not care about the hyphen in the "issuecomment-xxxx" when there are no other hyphens involved in the url. When the repo name has a single hyphen the parsing breaks at the issuecomment^- hyphen. When there are hyphens in the team name that owns the repo - the parsing breaks on the first one seen:

https://somesite.com/my^-orgname/repo-name/issuecomment-xxxx

This affects our install due to hyphens in repo names and hyphens in the org names that own the repo.

Screenshots

screen shot 2018-10-09 at 12 10 02 am

Originally created by @Alofoxx on GitHub (Oct 9, 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): 1.5.1 - Git version: Not relevant - Operating system: Ubuntu 16 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) --> https://try.gitea.io/alofoxx/testing-pr-comments/pulls/1#issuecomment-8071 - [ ] No - [ ] Not relevant - Log gist: Not relevant ## Description URL formatting breaks in PR comments when there is a hyphen in the URL (as there would be in any repo name that contains a hyphen). I recreated the issue in your demo site. https://try.gitea.io/alofoxx/testing-pr-comments/pulls/1#issuecomment-8069 The parsing seems to not care about the hyphen in the "issuecomment-xxxx" when there are no other hyphens involved in the url. When the repo name has a single hyphen the parsing breaks at the issuecomment^- hyphen. When there are hyphens in the team name that owns the repo - the parsing breaks on the first one seen: https://somesite.com/my^-orgname/repo-name/issuecomment-xxxx This affects our install due to hyphens in repo names and hyphens in the org names that own the repo. ## Screenshots ![screen shot 2018-10-09 at 12 10 02 am](https://user-images.githubusercontent.com/1343190/46652761-ea1b0500-cb58-11e8-8546-3fb74d21cc4a.png) <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/duplicate label 2025-11-02 04:34:37 -06:00
Author
Owner

@ghost commented on GitHub (Oct 16, 2018):

duplicated with #4435

@ghost commented on GitHub (Oct 16, 2018): duplicated with #4435
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2391