diff --git a/src/jqLite.js b/src/jqLite.js index d03ea67b4..a471d3742 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -205,17 +205,19 @@ function jqLiteIsTextNode(html) { function jqLiteBuildFragment(html, context) { var elem, tmp, tag, wrap, fragment = context.createDocumentFragment(), - nodes = [], i; + nodes = [], i, j, jj; if (jqLiteIsTextNode(html)) { // Convert non-html into a text node nodes.push(context.createTextNode(html)); } else { + tmp = fragment.appendChild(context.createElement('div')); // Convert html into DOM nodes - tmp = tmp || fragment.appendChild(context.createElement("div")); tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); wrap = wrapMap[tag] || wrapMap._default; - tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>$2>") + wrap[2]; + tmp.innerHTML = '