Some markdown links aren't rendered correctly #8097

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

Originally created by @qwerty287 on GitHub (Nov 12, 2021).

Gitea Version

1.16.0

Operating System

No response

Browser Version

Firefox 94.0

Can you reproduce the bug on the Gitea demo site?

Yes

Description

Some links aren't rendered correctly by the md parser.

  1. compare links are rendered like a link to a single commit, but the chars ...<second commit sha> is coming after this text.
  2. if I link to a permanent code snippet and add a single char after the link, the char is included in the rendered link (and in the link the href param is wrong too)

For an example on try with all issues: https://try.gitea.io/ktdkydkycoyf/ex/issues/2#issuecomment-112142

Screenshots

Examples:

  1. see https://codeberg.org/gitnex/GitNex/pulls/1008#issue-77442 - the fifth list point contains a compare link
  2. see https://codeberg.org/gitnex/GitNex/pulls/1014 (there is only one link in this comment, a permanent lines link with a trailing :
Originally created by @qwerty287 on GitHub (Nov 12, 2021). ### Gitea Version 1.16.0 ### Operating System _No response_ ### Browser Version Firefox 94.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Description Some links aren't rendered correctly by the md parser. 1. compare links are rendered like a link to a single commit, but the chars `...<second commit sha>` is coming after this text. 2. if I link to a permanent code snippet and add a single char after the link, the char is included in the rendered link (and in the link the `href` param is wrong too) For an example on try with all issues: https://try.gitea.io/ktdkydkycoyf/ex/issues/2#issuecomment-112142 ### Screenshots Examples: 1. see https://codeberg.org/gitnex/GitNex/pulls/1008#issue-77442 - the fifth list point contains a compare link 2. see https://codeberg.org/gitnex/GitNex/pulls/1014 (there is only one link in this comment, a permanent lines link with a trailing `:`
GiteaMirror added the issue/confirmedoutdated/theme/markdowntype/bug labels 2025-11-02 07:53:49 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Nov 15, 2021):

Can you prepare some simple reproducible samples on try.gitea.io? Then we can try to find some ways to fix it.

If you already have ideas about how to fix it, please advise 😊

@wxiaoguang commented on GitHub (Nov 15, 2021): Can you prepare some simple reproducible samples on try.gitea.io? Then we can try to find some ways to fix it. If you already have ideas about how to fix it, please advise 😊
Author
Owner

@qwerty287 commented on GitHub (Nov 15, 2021):

Not a repro step, but you can find this comment which summarizes the issues: https://try.gitea.io/ktdkydkycoyf/ex/issues/2#issuecomment-112142
The raw md content is in the code block below the actual comment content

@qwerty287 commented on GitHub (Nov 15, 2021): Not a repro step, but you can find this comment which summarizes the issues: https://try.gitea.io/ktdkydkycoyf/ex/issues/2#issuecomment-112142 The raw md content is in the code block below the actual comment content
Author
Owner

@wxiaoguang commented on GitHub (Dec 7, 2021):

I proposed a fix:

@wxiaoguang commented on GitHub (Dec 7, 2021): I proposed a fix: * https://github.com/go-gitea/gitea/pull/17924
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8097