The link tool, or Ctrl+K, opens a dialog: the address, the link's text (the selected text, which a new text replaces), and whether it opens in a new tab. With the caret in a link, the same tool changes it or removes it, keeping its text. Escape or Cancel closes the dialog and puts focus back in the text, with its selection.
Addresses can be web (https:, http:), mail (mailto:), phone (tel:) or relative. Any other scheme, such as javascript:, is refused in the dialog and removed by the sanitizer. A link that opens a new tab gets rel="noopener noreferrer".