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:
committed by
Ian Storm Taylor
parent
b4422ad6b3
commit
48caf855eb
@@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user