Steps to reproduce:
- Create a link to a page that doesn't exist, e.g. [[Visual Editor]]
- copy the link
- Go to the next line
- Paste the link
- Removing the space on the the label and the link on the second line, e.g. [[VisualEditor|VisualEditor]]
- Save the page
Expected:
[[Visual Editor]]
[[VisualEditor]]
Actual:
[[Visual Editor]]
[[VisualEditor|VisualEditor]]
Note: Pasting is essential (or at least one way) to replicate the issue
Similar issue: https://phabricator.wikimedia.org/T153107