docs: function makeReplacementTagCallback(tagName, componentTagData, shadowTagData, leakScope, getPrimaryTemplate) {
  
  	var options = shadowTagData.options;
  
  	// `replacementTag` is called when `<can-slot>` is found.
  	// Arguments:
  	// - `el` - the element
  	// - `insertionElementTagData` - the tagData where the element was found.
  	return function replacementTag(el, insertionElementTagData) {
  		// If there's no template to be rendered, we'll render what's inside the
  		// element. This is usually default content.
  		var template = getPrimaryTemplate(el) || insertionElementTagData.subtemplate,
  			// `true` if we are rendering something the user "passed" to this component.
  			renderingLightContent = template !== insertionElementTagData.subtemplate;
  
  		// If there's no template and no default content, we will do nothing. If
  		// there is a template to render, lets render it!
  		if (template) {
  
  			// It's possible that rendering the contents of a `<can-slot>` will end up
  			// rendering another `<can-slot>`.  We should make sure we can't render ourselves.
  			delete options.tags[tagName];
  
  			// First, lets figure out what we should be rendering
  			// the template with.
  			var tagData;
  
  			// If we are rendering something the user passed.
  			if( renderingLightContent ) {
  
  				if(leakScope.toLightContent) {
  					// We want to render with the same scope as the
  					// `insertionElementTagData.scope`, but we don't want the
  					// TemplateContext of the component's view included.
  					tagData = addContext(el, {
  						scope: insertionElementTagData.scope.cloneFromRef(),
  						options: insertionElementTagData.options
  					}, insertionElementTagData);
  				}
  				else {
  					// render with the same scope the component was found within.
  					tagData = addContext(el, componentTagData, insertionElementTagData);
  				}
  			} else {
  				// We are rendering default content so this content should
  				// use the same scope as the <content> tag was found within.
  				tagData = addContext(el, insertionElementTagData, insertionElementTagData);
  			}
  
  
  			// Now we need to render the right template and insert its result in the page.
  			// We need to teardown any bindings created too so we create a nodeList
  			// to do this.
  
  
  
  			var nodeList = nodeLists.register([el], tagData.teardown || noop,
  				insertionElementTagData.parentNodeList || true,
  				insertionElementTagData.directlyNested);
  
  			nodeList.expression = "<can-slot name='"+el.getAttribute('name')+"'/>";
  
  			var frag = template(tagData.scope, tagData.options, nodeList);
  			var newNodes = canReflect.toArray( getChildNodes(frag) );
  			var oldNodes = nodeLists.update(nodeList, newNodes);
  			nodeLists.replace(oldNodes, frag);
  
  			// Restore the proper tag function so it could potentially be used again (as in lists)
  			options.tags[tagName] = replacementTag;
  		}
  	};
  }