nextcloud / nextcloud/text

Cannot edit name of link with markdown syntax in the description

Open
#8,902 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: links needs info
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

This issue is created based on https://github.com/nextcloud/deck/issues/8189 where people said it is a text app issue. So here is the description (copied from the original issue):

When I make a link using the markdown syntax, I cannot later edit it at the end. When the text turns into the link, I can only delete from the end, but adding adds "after the square bracket". If I go into editing it (which is possible by the pop up window and the edit button), I can only edit the URL the link points to. I'm not sure what would be the best way to handle it. Maybe moving within the link should have a different a cursor and so going to the end would require two presses of the cursor mover keys. That may be painful to implement, but I think a lot of system uses it. Maybe if I go into the link, the editor should change the text back to the markdown. However, this would make using the link hard as clicking on it would change it back. Also, the edit button may make it possible to change the name of the link as well, not just the URL.

A workaround I found was to add the text in the middle of the description and delete the end. Like what follows:

Original, misspelled link: [Example link with minor typ](example.com)
If I go to the end and hit Backspace it deletes the p.
If I go to the end and type o an the letter appears but not as part of the link.
If I go between the y and the p and type po and hit DEL, the link would look like expected.

Thanks for looking into it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the markdown-link editing behavior described in the issue, including typing, Backspace, Delete, cursor movement, and the link edit popup. Done means the link text can be edited at the end without corrupting link behavior, while the URL remains editable and clicking the link still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, markdown
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.