From 39525f873b869fb277ada8ffdb9b77e2e0a1baa7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 24 Apr 2018 22:30:05 -0400 Subject: [PATCH] fix attribute stringification --- src/generators/nodes/Element.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generators/nodes/Element.ts b/src/generators/nodes/Element.ts index 7109bfc875..2bf174da45 100644 --- a/src/generators/nodes/Element.ts +++ b/src/generators/nodes/Element.ts @@ -371,7 +371,7 @@ export default class Element extends 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 + '>'; @@ -863,7 +863,7 @@ function getClaimStatement( : `{}`}, ${namespace === namespaces.svg ? true : false})`; } -function stringifyAttributeValue(value: Node | true) { +function stringifyAttributeValue(value: Node[] | true) { if (value === true) return ''; if (value.length === 0) return `=""`;