You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
We probably ought to have an extra function to check if a given node is an HTMLElement, and then use that to make an extra assertion before relying on children - something like:
function isHTMLElement(node) {
return node instanceof HTMLElement;
}
function isEmptyInlineElement(node) {
if (isHTMLElement(node)) {
if (node.children.length > 1) {
return false;
}
if (node.children.length === 1 && node.textContent.trim() !== '') {
return false;
}
if (node.children.length === 0) {
return node.textContent.trim() === '';
}
return isEmptyInlineElement(node.children[0]);
}
return false;
}
Activity
mindplay-dk commentedon Mar 15, 2016
We probably ought to have an extra function to check if a given node is an
HTMLElement, and then use that to make an extra assertion before relying onchildren- something like:rrees commentedon Apr 3, 2016
I agree with trying to implement the right check
katebee commentedon Feb 3, 2017
@rrees adding labels appears to have unassigned you 😢 (that was not intentional)