Skip to content

Note creation prompt triggered at the wrong character when the link text contains square brackets [] #317

Open
@brlin-tw

Description

@brlin-tw

Is this a hackmd.io issue?

What's the problem

When the link text contains square brackets the note creation prompt is triggered at the closing square bracket inside the link text instead of where it should be.

Current behaviour

Refer the following screen recording for bug reproduction:

2023.01.24.18.19.15.webm

Provide steps to reproduce:

  1. Enter [link text containing [] square brackets]
  2. Press ← once, notice no note creation prompt appears when it should be
  3. Move the cursor to the closing square bracket in the link text, and notice that the note creation prompt incorrectly triggered.

If possible, create a note with reproducible content and share the link with us.

note link: https://hackmd.io/pgbK2PrpTHmOxwcSZ3n2Pw

Expected behaviour

Note creation prompt appears at the outer closing square bracket

Environment

I use HackMD on:

Desktop

  • OS: Ubuntu 22.04 AMD64
  • Browser: Firefox
  • Browser Version: 109.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions