fix issue 1760
Use correct pattern for inserting links when pressing the buttons