Skip to content

Editor: Incorrect Markdown formatting when pasting URL via 'Add a link' button #34740

Closed
@MaxWebZ

Description

@MaxWebZ

Description

When adding a hyperlink using the "Add a link" button in issue/comment editor, pasting a URL results in incorrect Markdown formatting (double brackets) instead of replacing the placeholder text.

Steps to reproduce

  1. Type any text in the editor
  2. Select a text to use as link text
  3. Click the "Add a link" button on the toolbar
  4. The editor formats the selection to: [Example text](url) (with "url" pre-selected)
  5. Paste a URL from clipboard (Ctrl+V)

Expected behavior:
The result should be: [Example text](https://example.com)

Actual behavior:
The result is: [Example text]([url](https://example.com))

Browser

Google Chrome 137.0.7151.104

Gitea Version

1.24.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image

Image

Ctrl+V:

Image

Git Version

No response

Operating System

Windows 10 Pro 64-bit

How are you running Gitea?

Docker

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions