Don't replace existing link when uploading a file
Don't replace existing link when uploading a file

closes LS-1554
flag=rce_enhancements

If the cursor is w/in or adjacent to an existing link and the
user uploads a file, the new link replaces the existing one
rather than inserting a new one.

test plan:
  - put a link in the rce
  - have the cursor next to the link. You can even hit return
    so the cursor is on the next line.
  - Documents > upload file and upload a text file
  > expect a new link and for the existing link to remain
  - again, but move the cursor while the file is being uploaded
  > expect the new link to be where the cursor was when you started
    the upload
  - select some text, then upload a file
  > expect the file link to be on the selected text
  - ^that should work even if you move the cursor while the
    file is uploading
  - all this should work if you use Image > Upload Image and change
    the Display Option attribute to "Display Text Link"

Change-Id: Ibeea8107d4696e72d9c522943a5cd98055065884
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250455
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
Reviewed-by: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
QA-Review: Robin Kuss <0b206b54367b2de0334896ea45826f0e3194bd35@instructure.com>
Product-Review: Ed Schiebel <0ca8a83847a5889cf05cb219c0ab09f6b646243b@instructure.com>

sfu/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,sfu/canvas-lms