Steps to reproduce:
- Insert the cursor immediately after the first letter of a link
- Hit delete/backspace
- Type a new character
- The new character isn't part of the link, so select the entire word and click the link button
- Re-enter the link article
- Save your changes
If you started with "[[Porcupine]]", you should end up with "[[porcupine]]".
If you started with "[[Porcupine]]", you end up with "[[porcupine|p]][[Porcupine|orcupine]]".
This is just a common use case demonstrating a more general bug. Namely, if you create a new link that subsumes an existing link, the existing link is preserved within the new link instead of being replaced.