From a04ff218bbdc9c933537920feacb561d9d6c154d Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Mon, 1 May 2017 17:15:57 +0200 Subject: [PATCH] strip empty text nodes --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 09f2787..ae78ad4 100644 --- a/index.js +++ b/index.js @@ -131,6 +131,7 @@ function belCreateElement (tag, props, children) { } if (typeof node === 'string') { + if (/^[\n\r\s]+$/.test(node)) continue if (el.lastChild && el.lastChild.nodeName === '#text') { el.lastChild.nodeValue += node continue