|
|
@ -152,11 +152,16 @@ export function claim_element(nodes, name, attributes, svg) {
|
|
|
|
for (let i = 0; i < nodes.length; i += 1) {
|
|
|
|
for (let i = 0; i < nodes.length; i += 1) {
|
|
|
|
const node = nodes[i];
|
|
|
|
const node = nodes[i];
|
|
|
|
if (node.nodeName === name) {
|
|
|
|
if (node.nodeName === name) {
|
|
|
|
for (let j = 0; j < node.attributes.length; j += 1) {
|
|
|
|
let j = 0;
|
|
|
|
|
|
|
|
while (j < node.attributes.length) {
|
|
|
|
const attribute = node.attributes[j];
|
|
|
|
const attribute = node.attributes[j];
|
|
|
|
if (!attributes[attribute.name]) node.removeAttribute(attribute.name);
|
|
|
|
if (attributes[attribute.name]) {
|
|
|
|
|
|
|
|
j++;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
node.removeAttribute(attribute.name);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes
|
|
|
|
return nodes.splice(i, 1)[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|