Fixed some selection issues on the editor when inserting links.