Skip to content

Commit and issue comment hyperlinks surrounded by brackets broken in issue comments #7810

Closed
@vg-c

Description

@vg-c
  • Gitea version (or commit ref): 1.8.3
  • Git version: 2.17.2
  • Operating system: Amazon Linux 2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When a hyperlink to a commit or to an issue comment is surrounded by brackets in an issue comment, the parser/renderer includes the closing bracket with the hyperlink. The way it is rendered is shown in Screenshot 1, if you click on such a hyperlink then the Gitea web server weirdly asks for authentication, as shown in Screenshot 2, but even after authentication it doesn't work because of the closing bracket in the link, as shown in Screenshot 3.

I found that there is a way to avoid the parser/renderer from including the closing brackets in the link: if you add a space, dash, and some text after the closing bracket.

Annoyingly, I cannot reproduce this on try.gitea.io, all test cases work fine there: https://try.gitea.io/vg-c/testhyperlinks/issues/1

The Gitea server that I use is on a private AWS instance, but I'm pretty sure the bug could be reproduced with the specs given above.

Screenshots

  1. Rendering of a commit hyperlink surrounded by brackets in an issue comment:

Screenshot_2019-08-10_06-24-46

  1. What happens when you click on that hyperlink:

Screenshot_2019-08-10_06-28-02

  1. After authentication:

Screenshot_2019-08-10_06-55-01

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions