Skip to content

Commit

Permalink
strip empty text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed May 2, 2017
1 parent 6709607 commit a04ff21
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a04ff21

Please sign in to comment.