code: function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
                          previousCompileContext) {
        if (!($compileNodes instanceof jqLite)) {
          // jquery always rewraps, whereas we need to preserve the original selector so that we can
          // modify it.
          $compileNodes = jqLite($compileNodes);
        }
        // We can not compile top level text elements since text nodes can be merged and we will
        // not be able to attach scope data to them, so we will wrap them in <span>
        forEach($compileNodes, function(node, index){
          if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) {
            $compileNodes[index] = node = jqLite(node).wrap('<span></span>').parent()[0];
          }
        });
        var compositeLinkFn =
                compileNodes($compileNodes, transcludeFn, $compileNodes,
                             maxPriority, ignoreDirective, previousCompileContext);
        return function publicLinkFn(scope, cloneConnectFn, transcludeControllers){
          assertArg(scope, 'scope');
          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
          // and sometimes changes the structure of the DOM.
          var $linkNode = cloneConnectFn
            ? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!!
            : $compileNodes;
  
          forEach(transcludeControllers, function(instance, name) {
            $linkNode.data('$' + name + 'Controller', instance);
          });
  
          // Attach scope only to non-text nodes.
          for(var i = 0, ii = $linkNode.length; i<ii; i++) {
            var node = $linkNode[i];
            if (node.nodeType == 1 /* element */ || node.nodeType == 9 /* document */) {
              $linkNode.eq(i).data('$scope', scope);
            }
          }
          safeAddClass($linkNode, 'ng-scope');
          if (cloneConnectFn) cloneConnectFn($linkNode, scope);
          if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode);
          return $linkNode;
        };
      }
docs: ================================