Comparing version 0.1.10 to 0.1.11
@@ -0,1 +1,16 @@ | ||
// Create a range object for efficently rendering strings to elements. | ||
var range = document.createRange(); | ||
range.selectNode(document.body); | ||
function toElement(str) { | ||
var fragment; | ||
if (range.createContextualFragment) { | ||
fragment = range.createContextualFragment(str); | ||
} else { | ||
fragment = document.createElement('body'); | ||
fragment.innerHTML = str; | ||
} | ||
return fragment.childNodes[0]; | ||
} | ||
var specialElHandlers = { | ||
@@ -100,5 +115,3 @@ /** | ||
if (typeof toNode === 'string') { | ||
var newBodyEl = document.createElement('body'); | ||
newBodyEl.innerHTML = toNode; | ||
toNode = newBodyEl.childNodes[0]; | ||
toNode = toElement(toNode); | ||
} | ||
@@ -105,0 +118,0 @@ |
@@ -36,3 +36,3 @@ { | ||
"dependencies": {}, | ||
"version": "0.1.10" | ||
"version": "0.1.11" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133428
918