RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/** Checks if the node is an empty text node that can be ignored */
Checks if the node is an empty text node that can be ignored
Checks if the node is an empty text node that can be ignored
function isEmptyTextNode(node) {
    if (!node) {
        return true;
    }
    if (node.nodeType == 3 ) {
        var value = node.nodeValue;
        value = value.replace(LINE_BREAKS, '');
        return value.trim().length == 0;
    }
    var tagName = roosterjs_editor_dom_1.getTagOfNode(node);
    if (node.firstChild == node.lastChild && (tagName == 'SPAN' || tagName == 'FONT')) {
        return isEmptyTextNode(node.firstChild);
    }
    return false;
}
function isEmptyTextNode ( node ) { if ( ! node ) { return true ; } if ( node . nodeType == 3 ) { var value = node . nodeValue ; value = value . replace ( LINE_BREAKS , '' ) ; return value . trim ( ) . length == 0 ; } var tagName = roosterjs_editor_dom_1 . getTagOfNode ( node ) ; if ( node . firstChild == node . lastChild && ( tagName == 'SPAN' || tagName == 'FONT' ) ) { return isEmptyTextNode ( node . firstChild ) ; } return false ; }
Checks if the node is an empty text node that can be ignored
Checks if the node is an empty text node that can be ignored
// No node is empty // Empty text node is empty /* Text */ // Span or Font with an empty child node is empty // If not found, then this is not empty