RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Resolve an inline element by a leaf node
 * @param node The node to resolve from
 * @param parentBlock The parent block element
 */
Resolve an inline element by a leaf node
@param node The node to resolve from
@param parentBlock The parent block element
Resolve an inline element by a leaf node @param node The node to resolve from @param parentBlock The parent block element
function resolveInlineElement(node, parentBlock) {
    var nodeChain = [node];
    for (var parent_1 = node.parentNode; parent_1 && parentBlock.contains(parent_1); parent_1 = parent_1.parentNode) {
        nodeChain.push(parent_1);
    }
    var inlineElement;
    for (var i = nodeChain.length - 1; i >= 0 && !inlineElement; i--) {
        var currentNode = nodeChain[i];
        var tag = getTagOfNode_1.default(currentNode);
        if (tag == 'A') {
            inlineElement = new LinkInlineElement_1.default(currentNode, parentBlock);
        }
        else if (tag == 'IMG') {
            inlineElement = new ImageInlineElement_1.default(currentNode, parentBlock);
        }
    }
    return inlineElement || new NodeInlineElement_1.default(node, parentBlock);
}
function resolveInlineElement ( node , parentBlock ) { var nodeChain = [ node ] ; for ( var parent_1 = node . parentNode ; parent_1 && parentBlock . contains ( parent_1 ) ; parent_1 = parent_1 . parentNode ) { nodeChain . push ( parent_1 ) ; } var inlineElement ; for ( var i = nodeChain . length - 1 ; i >= 0 && ! inlineElement ; i -- ) { var currentNode = nodeChain [ i ] ; var tag = getTagOfNode_1 . default ( currentNode ) ; if ( tag == 'A' ) { inlineElement = new LinkInlineElement_1 . default ( currentNode , parentBlock ) ; } else if ( tag == 'IMG' ) { inlineElement = new ImageInlineElement_1 . default ( currentNode , parentBlock ) ; } } return inlineElement || new NodeInlineElement_1 . default ( node , parentBlock ) ; }
Resolve an inline element by a leaf node
 @param node The node to resolve from
 @param parentBlock The parent block element
Resolve an inline element by a leaf node @param node The node to resolve from @param parentBlock The parent block element