Filter out empty text nodes around newlines

master
Sven Slootweg 7 years ago
parent 643cacd208
commit 863a93e381

@ -17,7 +17,7 @@ module.exports = function splitTextComponents(treeList) {
/* Remove the last newline, because it's not delimiting anything. */ /* Remove the last newline, because it's not delimiting anything. */
splitItems.pop(); splitItems.pop();
return all.concat(splitItems); return all.concat(splitItems.filter(item => item.text != ""));
} else { } else {
return all.concat(flatten(item.contents, tagStack.concat([item]))); return all.concat(flatten(item.contents, tagStack.concat([item])));
} }

Loading…
Cancel
Save