From 3ed4ea12fa62bf8700bf31a481070bbe6a94729f Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Thu, 7 Feb 2019 00:51:59 +0000 Subject: [PATCH] fix(hdom): fix #72, update normalizeElement() - ensure empty elements with `__skip` attrib always have at least 1 child --- packages/hdom/src/normalize.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hdom/src/normalize.ts b/packages/hdom/src/normalize.ts index 575fa7c46c..d7246fd844 100644 --- a/packages/hdom/src/normalize.ts +++ b/packages/hdom/src/normalize.ts @@ -55,7 +55,9 @@ export const normalizeElement = attribs.class = clazz; } } - return [match[1], attribs, ...spec.slice(hasAttribs ? 2 : 1)]; + return attribs.__skip && spec.length < 3 ? + [match[1], attribs, ""] : + [match[1], attribs, ...spec.slice(hasAttribs ? 2 : 1)]; }; /**