MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / jqLiteBuildFragment

Function jqLiteBuildFragment

lib/test/angular/1.5.0/angular.js:2776–2811  ·  view source on GitHub ↗
(html, context)

Source from the content-addressed store, hash-verified

2774}
2775
2776function jqLiteBuildFragment(html, context) {
2777 var tmp, tag, wrap,
2778 fragment = context.createDocumentFragment(),
2779 nodes = [], i;
2780
2781 if (jqLiteIsTextNode(html)) {
2782 // Convert non-html into a text node
2783 nodes.push(context.createTextNode(html));
2784 } else {
2785 // Convert html into DOM nodes
2786 tmp = tmp || fragment.appendChild(context.createElement("div"));
2787 tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
2788 wrap = wrapMap[tag] || wrapMap._default;
2789 tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2];
2790
2791 // Descend through wrappers to the right content
2792 i = wrap[0];
2793 while (i--) {
2794 tmp = tmp.lastChild;
2795 }
2796
2797 nodes = concat(nodes, tmp.childNodes);
2798
2799 tmp = fragment.firstChild;
2800 tmp.textContent = "";
2801 }
2802
2803 // Remove wrapper from fragment
2804 fragment.textContent = "";
2805 fragment.innerHTML = ""; // Clear inner HTML
2806 forEach(nodes, function(node) {
2807 fragment.appendChild(node);
2808 });
2809
2810 return fragment;
2811}
2812
2813function jqLiteParseHTML(html, context) {
2814 context = context || document;

Callers 2

jqLiteParseHTMLFunction · 0.70
angular.jsFile · 0.70

Calls 3

jqLiteIsTextNodeFunction · 0.70
concatFunction · 0.70
forEachFunction · 0.70

Tested by

no test coverage detected