Skip to content

Commit

Permalink
fix(hdom): fix #72, update normalizeElement()
Browse files Browse the repository at this point in the history
- ensure empty elements with `__skip` attrib always have at least 1 child
  • Loading branch information
postspectacular committed Feb 7, 2019
1 parent 2b3dd7f commit 3ed4ea1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hdom/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
};

/**
Expand Down

0 comments on commit 3ed4ea1

Please sign in to comment.