Skip to content

Commit

Permalink
makes compat work with EJS
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer authored and mjstahl committed Jan 13, 2016
1 parent e1c43c2 commit 8e36012
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion util/fragment.js
Expand Up @@ -50,7 +50,13 @@ steal('can/util/can.js', function (can) {
if(html && html.nodeType === 11) {
return html;
}
var parts = fragment(html, undefined, doc || document),
if(!doc) {
doc = document;
} else if(doc.length) {
doc = doc[0];
}

var parts = fragment(html, undefined, doc),
frag = (doc || document).createDocumentFragment();
for(var i = 0, length = parts.length; i < length; i++) {
frag.appendChild(parts[i]);
Expand Down

0 comments on commit 8e36012

Please sign in to comment.