Questions: is there any workaround to keep the originally selected text unchanged after the internal link is created?

If I try to link selected text to an existing node, is there any workaround to keep the originally selected text unchanged after the internal link is created?

I have implemented link_selected_texts to_existing _nodes feature but I have to no idea about how to keep it unchanging.