react-html-parser icon indicating copy to clipboard operation
react-html-parser copied to clipboard

remove isEmptyTextNode check

Open kdojeteri opened this issue 7 years ago • 1 comments

I suggest this as a fix for https://github.com/wrakky/react-html-parser/issues/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() === '';
}

kdojeteri avatar Jan 30 '18 17:01 kdojeteri

Coverage Status

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

coveralls avatar Jan 30 '18 17:01 coveralls