fix attribute stringification

pull/1367/head
Rich Harris 7 years ago
parent 4e705d2cb7
commit 39525f873b

@ -371,7 +371,7 @@ export default class Element extends Node {
} }
node.attributes.forEach((attr: Node) => { node.attributes.forEach((attr: Node) => {
open += ` ${fixAttributeCasing(attr.name)}${stringifyAttributeValue(attr.value)}` open += ` ${fixAttributeCasing(attr.name)}${stringifyAttributeValue(attr.chunks)}`
}); });
if (isVoidElementName(node.name)) return open + '>'; if (isVoidElementName(node.name)) return open + '>';
@ -863,7 +863,7 @@ function getClaimStatement(
: `{}`}, ${namespace === namespaces.svg ? true : false})`; : `{}`}, ${namespace === namespaces.svg ? true : false})`;
} }
function stringifyAttributeValue(value: Node | true) { function stringifyAttributeValue(value: Node[] | true) {
if (value === true) return ''; if (value === true) return '';
if (value.length === 0) return `=""`; if (value.length === 0) return `=""`;

Loading…
Cancel
Save