diff --git a/esm.js b/esm.js
index 4e541fcf..2ddb4f41 100644
--- a/esm.js
+++ b/esm.js
@@ -1,13 +1,13 @@
-/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(g){"use strict";
-/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=o.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(e){n(this,"_",{value:"_@ungap/weakmap"+t++}),e&&e.forEach(a,this)}function a(e){this.set(e[0],e[1])}}(Math.random(),Object)}var u=t.WeakMap,i={};
+/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(w){"use strict";
+/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,"_",{value:"_@ungap/weakmap"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var u=t.WeakMap,i={};
/*! (c) Andrea Giammarchi - ISC */try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}var e=i.WeakSet,n={};
-/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,r=[],i=[];return{delete:function(e){var t=o(e);return t&&(r.splice(n,1),i.splice(n,1)),t},get:function(e){return o(e)?i[n]:void 0},has:function(e){return o(e)},set:function(e,t){return i[o(e)?n:r.push(e)-1]=t,this}};function o(e){return-1<(n=r.indexOf(e))}}}function b(e,t,n,r,i,o){for(var a=("selectedIndex"in t),u=-1;ra;)--c;l=u+r-c;var g=Array(l),b=s[c];for(--n;b;){for(var y=b,w=y.newi,N=y.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return $(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(m),n=R("div");return n.innerHTML='",$(t,n.firstChild.childNodes),t}:T)(e)});function $(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===m?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
+/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,r=[],i=[];return{delete:function(e){var t=a(e);return t&&(r.splice(n,1),i.splice(n,1)),t},get:function(e){return a(e)?i[n]:void 0},has:function(e){return a(e)},set:function(e,t){return i[a(e)?n:r.push(e)-1]=t,this}};function a(e){return-1<(n=r.indexOf(e))}}}function m(e,t,n,r,i,a){for(var o=("selectedIndex"in t),u=-1;ro;)--s;l=u+r-s;var m=Array(l),y=c[s];for(--n;y;){for(var b=y,w=b.newi,N=b.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return W(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(g),n=R("div");return n.innerHTML='",W(t,n.firstChild.childNodes),t}:T)(e)});function W(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===g?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
/*! (c) Andrea Giammarchi - ISC */
-var F,H,z,I,Z,B,V,G,q,J,K=(H="appendChild",z="cloneNode",I="createTextNode",B=(Z="importNode")in(F=g),(V=F.createDocumentFragment())[H](F[I]("g")),V[H](F[I]("")),(B?F[Z](V,!0):V[z](!0)).childNodes.length<2?function e(t,n){for(var r=t[z](),i=t.childNodes||[],o=i.length,a=0;n&&a
',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",oe="[^"+ie+"\\/>\"'=]+",ae="["+ie+"]+"+oe,ue="<([A-Za-z]+[A-Za-z0-9:_-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ue+ae+ce+"+)(["+ie+"]*/?>)","g"),se=new RegExp(ue+ae+ce+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+ae+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t,n,r){return{name:r,node:t,path:n,type:e}}function me(e,t){for(var n=t.length,r=0;r',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",ae="[^"+ie+"\\/>\"'=]+",oe="["+ie+"]+"+ae,ue="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ae.replace("\\/","")+"))?)",le=new RegExp(ue+oe+se+"+)(["+ie+"]*/?>)","g"),ce=new RegExp(ue+oe+se+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+oe+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t){for(var n=t.length,r=0;r"\'=]+';
var attrName = '[' + spaces + ']+' + almostEverything;
- var tagName = '<([A-Za-z]+[A-Za-z0-9:_-]*)((?:';
+ var tagName = '<([A-Za-z]+[A-Za-z0-9:._-]*)((?:';
var attrPartials = '(?:\\s*=\\s*(?:\'[^\']*?\'|"[^"]*?"|<[^>]*?>|' + almostEverything.replace('\\/', '') + '))?)';
var attrSeeker = new RegExp(tagName + attrName + attrPartials + '+)([' + spaces + ']*/?>)', 'g');
var selfClosing = new RegExp(tagName + attrName + attrPartials + '*)([' + spaces + ']*/>)', 'g');
@@ -965,15 +965,6 @@ var hyperHTML = (function (document) {
return VOID_ELEMENTS.test($1) ? $0 : '<' + $1 + $2 + '>' + $1 + '>';
}
- function create(type, node, path, name) {
- return {
- name: name,
- node: node,
- path: path,
- type: type
- };
- }
-
function find(node, path) {
var length = path.length;
var i = 0;
@@ -1008,7 +999,7 @@ var hyperHTML = (function (document) {
holes.push( // basicHTML or other non standard engines
// might end up having comments in nodes
// where they shouldn't, hence this check.
- SHOULD_USE_TEXT_CONTENT.test(node.nodeName) ? create('text', node, path) : create('any', child, path.concat(i)));
+ SHOULD_USE_TEXT_CONTENT.test(node.nodeName) ? Text(node, path) : Any(child, path.concat(i)));
} else {
switch (textContent.slice(0, 2)) {
case '/*':
@@ -1033,7 +1024,7 @@ var hyperHTML = (function (document) {
/* istanbul ignore if */
if (SHOULD_USE_TEXT_CONTENT.test(node.nodeName) && trim.call(child.textContent) === UIDC) {
parts.shift();
- holes.push(create('text', node, path));
+ holes.push(Text(node, path));
}
break;
@@ -1053,22 +1044,32 @@ var hyperHTML = (function (document) {
while (i < length) {
var attribute = array[i++];
+ var direct = attribute.value === UID;
+ var sparse;
- if (attribute.value === UID) {
+ if (direct || 1 < (sparse = attribute.value.split(UIDC)).length) {
var name = attribute.name; // the following ignore is covered by IE
// and the IE9 double viewBox test
/* istanbul ignore else */
if (!cache.has(name)) {
- var realName = parts.shift().replace(/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*['"]?$/, '$1');
+ var realName = parts.shift().replace(direct ? /^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/ : new RegExp('^(?:|[\\S\\s]*?\\s)(' + name + ')\\s*=\\s*(\'|")', 'i'), '$1');
var value = attributes[realName] || // the following ignore is covered by browsers
// while basicHTML is already case-sensitive
/* istanbul ignore next */
attributes[realName.toLowerCase()];
cache.set(name, value);
- holes.push(create('attr', value, path, realName));
+ if (direct) holes.push(Attr(value, path, realName, null));else {
+ var skip = sparse.length - 2;
+
+ while (skip--) {
+ parts.shift();
+ }
+
+ holes.push(Attr(value, path, realName, sparse));
+ }
}
remove.push(attribute);
@@ -1112,6 +1113,32 @@ var hyperHTML = (function (document) {
}
}
+ function Any(node, path) {
+ return {
+ type: 'any',
+ node: node,
+ path: path
+ };
+ }
+
+ function Attr(node, path, name, sparse) {
+ return {
+ type: 'attr',
+ node: node,
+ path: path,
+ name: name,
+ sparse: sparse
+ };
+ }
+
+ function Text(node, path) {
+ return {
+ type: 'text',
+ node: node,
+ path: path
+ };
+ }
+
// globals
var parsed = new WeakMap$1();
var referenced = new WeakMap$1();
@@ -1127,9 +1154,10 @@ var hyperHTML = (function (document) {
var info = {
content: content,
updates: function updates(content) {
- var callbacks = [];
+ var updates = [];
var len = holes.length;
var i = 0;
+ var off = 0;
while (i < len) {
var info = holes[i++];
@@ -1137,31 +1165,65 @@ var hyperHTML = (function (document) {
switch (info.type) {
case 'any':
- callbacks.push(options.any(node, []));
+ updates.push({
+ fn: options.any(node, []),
+ sparse: false
+ });
break;
case 'attr':
- callbacks.push(options.attribute(node, info.name, info.node));
+ var sparse = info.sparse;
+ var fn = options.attribute(node, info.name, info.node);
+ if (sparse === null) updates.push({
+ fn: fn,
+ sparse: false
+ });else {
+ off += sparse.length - 2;
+ updates.push({
+ fn: fn,
+ sparse: true,
+ values: sparse
+ });
+ }
break;
case 'text':
- callbacks.push(options.text(node));
+ updates.push({
+ fn: options.text(node),
+ sparse: false
+ });
node.textContent = '';
break;
}
}
+ len += off;
return function () {
var length = arguments.length;
- var values = length - 1;
- var i = 1;
- if (len !== values) {
- throw new Error(values + ' values instead of ' + len + '\n' + template.join(', '));
+ if (len !== length - 1) {
+ throw new Error(length - 1 + ' values instead of ' + len + '\n' + template.join('${value}'));
}
+ var i = 1;
+ var off = 1;
+
while (i < length) {
- callbacks[i - 1](arguments[i++]);
+ var update = updates[i - off];
+
+ if (update.sparse) {
+ var values = update.values;
+ var value = values[0];
+ var j = 1;
+ var l = values.length;
+ off += l - 2;
+
+ while (j < l) {
+ value += arguments[i++] + values[j++];
+ }
+
+ update.fn(value);
+ } else update.fn(arguments[i++]);
}
return content;
diff --git a/min.js b/min.js
index f024d2d5..52bfa91f 100644
--- a/min.js
+++ b/min.js
@@ -1,11 +1,11 @@
-/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(g){"use strict";
-/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=o.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},o;function o(e){n(this,"_",{value:"_@ungap/weakmap"+t++}),e&&e.forEach(a,this)}function a(e){this.set(e[0],e[1])}}(Math.random(),Object)}var u=t.WeakMap,i={};
+/*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(w){"use strict";
+/*! (c) Andrea Giammarchi - ISC */var t={};try{t.WeakMap=WeakMap}catch(e){t.WeakMap=function(t,e){var n=e.defineProperty,r=e.hasOwnProperty,i=a.prototype;return i.delete=function(e){return this.has(e)&&delete e[this._]},i.get=function(e){return this.has(e)?e[this._]:void 0},i.has=function(e){return r.call(e,this._)},i.set=function(e,t){return n(e,this._,{configurable:!0,value:t}),this},a;function a(e){n(this,"_",{value:"_@ungap/weakmap"+t++}),e&&e.forEach(o,this)}function o(e){this.set(e[0],e[1])}}(Math.random(),Object)}var u=t.WeakMap,i={};
/*! (c) Andrea Giammarchi - ISC */try{i.WeakSet=WeakSet}catch(e){!function(e,t){var n=r.prototype;function r(){t(this,"_",{value:"_@ungap/weakmap"+e++})}n.add=function(e){return this.has(e)||t(e,this._,{value:!0,configurable:!0}),this},n.has=function(e){return this.hasOwnProperty.call(e,this._)},n.delete=function(e){return this.has(e)&&delete e[this._]},i.WeakSet=r}(Math.random(),Object.defineProperty)}var e=i.WeakSet,n={};
-/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,r=[],i=[];return{delete:function(e){var t=o(e);return t&&(r.splice(n,1),i.splice(n,1)),t},get:function(e){return o(e)?i[n]:void 0},has:function(e){return o(e)},set:function(e,t){return i[o(e)?n:r.push(e)-1]=t,this}};function o(e){return-1<(n=r.indexOf(e))}}}function b(e,t,n,r,i,o){for(var a=("selectedIndex"in t),u=-1;ra;)--c;l=u+r-c;var g=Array(l),b=s[c];for(--n;b;){for(var y=b,w=y.newi,N=y.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return $(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(m),n=R("div");return n.innerHTML='",$(t,n.firstChild.childNodes),t}:T)(e)});function $(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===m?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
+/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,r=[],i=[];return{delete:function(e){var t=a(e);return t&&(r.splice(n,1),i.splice(n,1)),t},get:function(e){return a(e)?i[n]:void 0},has:function(e){return a(e)},set:function(e,t){return i[a(e)?n:r.push(e)-1]=t,this}};function a(e){return-1<(n=r.indexOf(e))}}}function m(e,t,n,r,i,a){for(var o=("selectedIndex"in t),u=-1;ro;)--s;l=u+r-s;var m=Array(l),y=c[s];for(--n;y;){for(var b=y,w=b.newi,N=b.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return W(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(g),n=R("div");return n.innerHTML='",W(t,n.firstChild.childNodes),t}:T)(e)});function W(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===g?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
/*! (c) Andrea Giammarchi - ISC */
-var F,H,z,I,Z,B,V,G,q,J,K=(H="appendChild",z="cloneNode",I="createTextNode",B=(Z="importNode")in(F=g),(V=F.createDocumentFragment())[H](F[I]("g")),V[H](F[I]("")),(B?F[Z](V,!0):V[z](!0)).childNodes.length<2?function e(t,n){for(var r=t[z](),i=t.childNodes||[],o=i.length,a=0;n&&a',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",oe="[^"+ie+"\\/>\"'=]+",ae="["+ie+"]+"+oe,ue="<([A-Za-z]+[A-Za-z0-9:_-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ue+ae+ce+"+)(["+ie+"]*/?>)","g"),se=new RegExp(ue+ae+ce+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+ae+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t,n,r){return{name:r,node:t,path:n,type:e}}function me(e,t){for(var n=t.length,r=0;r',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",ae="[^"+ie+"\\/>\"'=]+",oe="["+ie+"]+"+ae,ue="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ae.replace("\\/","")+"))?)",le=new RegExp(ue+oe+se+"+)(["+ie+"]*/?>)","g"),ce=new RegExp(ue+oe+se+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+oe+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t){for(var n=t.length,r=0;ra;)--c;l=u+r-c;var g=Array(l),b=s[c];for(--n;b;){for(var y=b,w=y.newi,N=y.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return $(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(m),n=R("div");return n.innerHTML='",$(t,n.firstChild.childNodes),t}:T)(e)});function $(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===m?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
+/*! (c) Andrea Giammarchi - ISC */try{n.Map=Map}catch(e){n.Map=function(){var n=0,r=[],i=[];return{delete:function(e){var t=a(e);return t&&(r.splice(n,1),i.splice(n,1)),t},get:function(e){return a(e)?i[n]:void 0},has:function(e){return a(e)},set:function(e,t){return i[a(e)?n:r.push(e)-1]=t,this}};function a(e){return-1<(n=r.indexOf(e))}}}function m(e,t,n,r,i,a){for(var o=("selectedIndex"in t),u=-1;ro;)--s;l=u+r-s;var m=Array(l),y=c[s];for(--n;y;){for(var b=y,w=b.newi,N=b.oldi;w>>0;n"+e+"",r=n.querySelectorAll(i)}else n.innerHTML=e,r=n.childNodes;return W(t,r),t},function(e,t){return("svg"===t?function(e){var t=R(g),n=R("div");return n.innerHTML='",W(t,n.firstChild.childNodes),t}:T)(e)});function W(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function R(e){return e===g?p.createDocumentFragment():p.createElementNS("http://www.w3.org/1999/xhtml",e)}
/*! (c) Andrea Giammarchi - ISC */
-var F,H,z,I,Z,B,V,G,q,J,K=(H="appendChild",z="cloneNode",I="createTextNode",B=(Z="importNode")in(F=g),(V=F.createDocumentFragment())[H](F[I]("g")),V[H](F[I]("")),(B?F[Z](V,!0):V[z](!0)).childNodes.length<2?function e(t,n){for(var r=t[z](),i=t.childNodes||[],o=i.length,a=0;n&&a',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",oe="[^"+ie+"\\/>\"'=]+",ae="["+ie+"]+"+oe,ue="<([A-Za-z]+[A-Za-z0-9:_-]*)((?:",ce="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+oe.replace("\\/","")+"))?)",le=new RegExp(ue+ae+ce+"+)(["+ie+"]*/?>)","g"),se=new RegExp(ue+ae+ce+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+ae+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t,n,r){return{name:r,node:t,path:n,type:e}}function me(e,t){for(var n=t.length,r=0;r',G[q].childNodes[0].getAttribute(J)==U)||(U="_dt: "+U.slice(1,-1)+";",!0)}catch(e){}var X="\x3c!--"+U+"--\x3e",Y=8,ee=1,te=3,ne=/^(?:style|textarea)$/i,re=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;var ie=" \\f\\n\\r\\t",ae="[^"+ie+"\\/>\"'=]+",oe="["+ie+"]+"+ae,ue="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",se="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+ae.replace("\\/","")+"))?)",le=new RegExp(ue+oe+se+"+)(["+ie+"]*/?>)","g"),ce=new RegExp(ue+oe+se+"*)(["+ie+"]*/>)","g"),fe=new RegExp("("+oe+"\\s*=\\s*)(['\"]?)"+X+"\\2","gi");function he(e,t,n,r){return"<"+t+n.replace(fe,de)+r}function de(e,t,n){return t+(n||'"')+U+(n||'"')}function ve(e,t,n){return re.test(t)?e:"<"+t+n+">"+t+">"}function pe(e,t){for(var n=t.length,r=0;r