Skip to content

Conversation

kdojeteri
Copy link

I suggest this as a fix for #39


To be honest, I don't even know why you would assume that only specifically whitespace nodes with newlines are empty. Yet that's what the code says.

export default function isEmptyTextNode(node) {
  return node.type === 'text' && /\r?\n/.test(node.data) && node.data.trim() === '';
}

@coveralls
Copy link

coveralls commented Jan 30, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 042af2a on Peping:master into f28597e on wrakky:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants