|
|
@ -21,13 +21,7 @@ export function toVNode(node: Node, domApi?: DOMAPI): VNode {
|
|
|
|
const elmChildren = node.childNodes;
|
|
|
|
const elmChildren = node.childNodes;
|
|
|
|
for (i = 0, n = elmAttrs.length; i < n; i++) {
|
|
|
|
for (i = 0, n = elmAttrs.length; i < n; i++) {
|
|
|
|
name = elmAttrs[i].nodeName;
|
|
|
|
name = elmAttrs[i].nodeName;
|
|
|
|
if (
|
|
|
|
if (name.startsWith("data-")) {
|
|
|
|
name[0] === "d" &&
|
|
|
|
|
|
|
|
name[1] === "a" &&
|
|
|
|
|
|
|
|
name[2] === "t" &&
|
|
|
|
|
|
|
|
name[3] === "a" &&
|
|
|
|
|
|
|
|
name[4] === "-"
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
dataset[name.slice(5)] = elmAttrs[i].nodeValue || "";
|
|
|
|
dataset[name.slice(5)] = elmAttrs[i].nodeValue || "";
|
|
|
|
} else if (name !== "id" && name !== "class") {
|
|
|
|
} else if (name !== "id" && name !== "class") {
|
|
|
|
attrs[name] = elmAttrs[i].nodeValue;
|
|
|
|
attrs[name] = elmAttrs[i].nodeValue;
|
|
|
@ -41,9 +35,7 @@ export function toVNode(node: Node, domApi?: DOMAPI): VNode {
|
|
|
|
if (Object.keys(dataset).length > 0) data.dataset = dataset;
|
|
|
|
if (Object.keys(dataset).length > 0) data.dataset = dataset;
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
sel[0] === "s" &&
|
|
|
|
sel.startsWith("svg") &&
|
|
|
|
sel[1] === "v" &&
|
|
|
|
|
|
|
|
sel[2] === "g" &&
|
|
|
|
|
|
|
|
(sel.length === 3 || sel[3] === "." || sel[3] === "#")
|
|
|
|
(sel.length === 3 || sel[3] === "." || sel[3] === "#")
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
addNS(data, children, sel);
|
|
|
|
addNS(data, children, sel);
|
|
|
|