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