(html, context)
| 2319 | } |
| 2320 | |
| 2321 | function jqLiteBuildFragment(html, context) { |
| 2322 | var elem, tmp, tag, wrap, |
| 2323 | fragment = context.createDocumentFragment(), |
| 2324 | nodes = [], i, j, jj; |
| 2325 | |
| 2326 | if (jqLiteIsTextNode(html)) { |
| 2327 | // Convert non-html into a text node |
| 2328 | nodes.push(context.createTextNode(html)); |
| 2329 | } else { |
| 2330 | tmp = fragment.appendChild(context.createElement('div')); |
| 2331 | // Convert html into DOM nodes |
| 2332 | tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); |
| 2333 | wrap = wrapMap[tag] || wrapMap._default; |
| 2334 | tmp.innerHTML = '<div> </div>' + |
| 2335 | wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2]; |
| 2336 | tmp.removeChild(tmp.firstChild); |
| 2337 | |
| 2338 | // Descend through wrappers to the right content |
| 2339 | i = wrap[0]; |
| 2340 | while (i--) { |
| 2341 | tmp = tmp.lastChild; |
| 2342 | } |
| 2343 | |
| 2344 | for (j=0, jj=tmp.childNodes.length; j<jj; ++j) nodes.push(tmp.childNodes[j]); |
| 2345 | |
| 2346 | tmp = fragment.firstChild; |
| 2347 | tmp.textContent = ""; |
| 2348 | } |
| 2349 | |
| 2350 | // Remove wrapper from fragment |
| 2351 | fragment.textContent = ""; |
| 2352 | fragment.innerHTML = ""; // Clear inner HTML |
| 2353 | return nodes; |
| 2354 | } |
| 2355 | |
| 2356 | function jqLiteParseHTML(html, context) { |
| 2357 | context = context || document; |
no test coverage detected