Comparing version 1.0.0 to 1.1.1
{ | ||
"name": "domify", | ||
"version": "1.0.0", | ||
"version": "1.1.1", | ||
"description": "turn HTML into DOM elements", | ||
@@ -5,0 +5,0 @@ "scripts": ["index.js"], |
@@ -0,8 +1,18 @@ | ||
1.1.1 / 2013-11-05 | ||
================== | ||
1.0.0 / 2013-06-13 | ||
* use createTextNode() [jkroso] | ||
1.1.0 / 2013-11-05 | ||
================== | ||
* do not rely on live .children NodeList [timoxley] | ||
* generate text node if not given an html tag [timoxley] | ||
1.0.0 / 2013-06-13 | ||
================== | ||
* return document fragments for multiple top level nodes | ||
0.2.0 / 2013-05-21 | ||
0.2.0 / 2013-05-21 | ||
================== | ||
@@ -12,3 +22,3 @@ | ||
0.1.0 / 2012-10-24 | ||
0.1.0 / 2012-10-24 | ||
================== | ||
@@ -21,3 +31,3 @@ | ||
0.0.3 / 2012-08-28 | ||
0.0.3 / 2012-08-28 | ||
================== | ||
@@ -27,3 +37,3 @@ | ||
0.0.2 / 2012-08-01 | ||
0.0.2 / 2012-08-01 | ||
================== | ||
@@ -30,0 +40,0 @@ |
16
index.js
@@ -39,5 +39,7 @@ | ||
html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing whitespace | ||
// tag name | ||
var m = /<([\w:]+)/.exec(html); | ||
if (!m) throw new Error('No elements were generated.'); | ||
if (!m) return document.createTextNode(html); | ||
var tag = m[1]; | ||
@@ -61,10 +63,12 @@ | ||
var els = el.children; | ||
if (1 == els.length) { | ||
return el.removeChild(els[0]); | ||
// Note: when moving children, don't rely on el.children | ||
// being 'live' to support Polymer's broken behaviour. | ||
// See: https://github.com/component/domify/pull/23 | ||
if (1 == el.children.length) { | ||
return el.removeChild(el.children[0]); | ||
} | ||
var fragment = document.createDocumentFragment(); | ||
while (els.length) { | ||
fragment.appendChild(el.removeChild(els[0])); | ||
while (el.children.length) { | ||
fragment.appendChild(el.removeChild(el.children[0])); | ||
} | ||
@@ -71,0 +75,0 @@ |
{ | ||
"name": "domify" | ||
, "version": "1.0.0" | ||
, "description": "turn HTML into DOM elements" | ||
, "keywords": ["dom", "html", "client", "browser", "component"] | ||
, "author": "TJ Holowaychuk <tj@vision-media.ca>" | ||
, "dependencies": {} | ||
, "component": { | ||
"scripts": { | ||
"domify": "index.js" | ||
"name": "domify", | ||
"version": "1.1.1", | ||
"description": "turn HTML into DOM elements", | ||
"keywords": [ | ||
"dom", | ||
"html", | ||
"client", | ||
"browser", | ||
"component" | ||
], | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
"dependencies": {}, | ||
"component": { | ||
"scripts": { | ||
"domify": "index.js" | ||
} | ||
}, | ||
"main": "index", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/component/domify.git" | ||
} | ||
} | ||
, "main": "index" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
270810
11070
14