setHrefAndLink = function(element, index, arr) {
      'use strict';
      // We can't do straight comparison since the href can contain the
      // absolute url.
      if (goog.string.endsWith(element.href, uniqueId)) {
        anchors.push(element);
      }
    }
Create a link out of the current selection.  If nothing is selected, insert
a new link.  Otherwise, enclose the selection in a link.
@param {goog.dom.AbstractRange} range The closure range object for the
    current selection.
@param {string} url The url to link to.
@param {string=} opt_target Target for the link.
@return {goog.editor.Link?} The newly created link, or null if the link
    couldn't be created.
@private
@suppress {strictMissingProperties} Added to tighten compiler checks