Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dom.placeCaretAtVerticalEdge(undefined, false);
// $ExpectType void
dom.remove(node);
// $ExpectType void
dom.replace(node, node);
// $ExpectType HTMLParagraphElement
dom.replaceTag(node, 'p');
// $ExpectType HTMLSpanElement
dom.replaceTag(node, 'span');
// $ExpectType void
dom.unwrap(node);
// $ExpectType void
dom.wrap(node, node);
prevListItem.appendChild( list );
parentList.removeChild( parentListItem );
} else {
parentList.parentNode.insertBefore( list, parentList );
parentList.parentNode.removeChild( parentList );
}
}
// Invalid: OL/UL > OL/UL.
if ( parentElement && isList( parentElement ) ) {
const prevListItem = node.previousElementSibling;
if ( prevListItem ) {
prevListItem.appendChild( node );
} else {
unwrap( node );
}
}
}
remove( node.firstChild );
}
}
}
}
// Invalid child. Continue with schema at the same place and unwrap.
} else {
cleanNodeList( node.childNodes, doc, schema, inline );
// For inline mode, insert a line break when unwrapping nodes that
// are not phrasing content.
if ( inline && ! isPhrasingContent( node ) && node.nextElementSibling ) {
insertAfter( doc.createElement( 'br' ), node );
}
unwrap( node );
}
} );
}
// If a parent requires certain children, but it does
// not have them, drop the parent and continue.
if ( require.length && ! node.querySelector( require.join( ',' ) ) ) {
cleanNodeList( node.childNodes, doc, schema, inline );
unwrap( node );
// If the node is at the top, phrasing content, and
// contains children that are block content, unwrap
// the node because it is invalid.
} else if (
node.parentNode.nodeName === 'BODY' &&
isPhrasingContent( node )
) {
cleanNodeList( node.childNodes, doc, schema, inline );
if ( Array.from( node.childNodes ).some( ( child ) => ! isPhrasingContent( child ) ) ) {
unwrap( node );
}
} else {
cleanNodeList( node.childNodes, doc, children, inline );
}
// Remove children if the node is not supposed to have any.
} else {
while ( node.firstChild ) {
remove( node.firstChild );
}
}
}
}
// Invalid child. Continue with schema at the same place and unwrap.
} else {
cleanNodeList( node.childNodes, doc, schema, inline );