1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

avoid innerText (#1837)

better to avoid innerText https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#Differences_from_innerText
This commit is contained in:
Cyril Auburtin
2018-05-21 08:32:09 +02:00
committed by Ian Storm Taylor
parent b4422ad6b3
commit 48caf855eb

View File

@@ -34,7 +34,7 @@ function cloneFragment(event, value, fragment = value.fragment) {
// Make sure attach is a non-empty node, since empty nodes will not get copied // Make sure attach is a non-empty node, since empty nodes will not get copied
contents.childNodes.forEach(node => { contents.childNodes.forEach(node => {
if (node.innerText && node.innerText.trim() !== '') { if (node.textContent && node.textContent.trim() !== '') {
attach = node attach = node
} }
}) })