packages/parse5/lib/parser/index.js
function aaObtainFurthestBlock(p, formattingElementEntry) {
    let furthestBlock = null;

    for (let i = p.openElements.stackTop; i >= 0; i--) {
        const element = p.openElements.items[i];

        if (element === formattingElementEntry.element) {
            break;
        }

        if (p._isSpecialElement(element)) {
            furthestBlock = element;
        }
    }

    if (!furthestBlock) {
        p.openElements.popUntilElementPopped(formattingElementEntry.element);
        p.activeFormattingElements.removeEntry(formattingElementEntry);
    }

    return furthestBlock;
}
function aaObtainFurthestBlock(p, formattingElementEntry) {
    let furthestBlock = null;

    for (let i = p.openElements.stackTop; i >= 0; i--) {
        const element = p.openElements.items[i];

        if (element === formattingElementEntry.element) {
            break;
        }

        if (p._isSpecialElement(element)) {
            furthestBlock = element;
        }
    }

    if (!furthestBlock) {
        p.openElements.popUntilElementPopped(formattingElementEntry.element);
        p.activeFormattingElements.removeEntry(formattingElementEntry);
    }

    return furthestBlock;
}
function aaObtainFurthestBlock ( p , formattingElementEntry ) { let furthestBlock = null ; for ( let i = p . openElements . stackTop ; i >= 0 ; i -- ) { const element = p . openElements . items [ i ] ; if ( element === formattingElementEntry . element ) { break ; } if ( p . _isSpecialElement ( element ) ) { furthestBlock = element ; } } if ( ! furthestBlock ) { p . openElements . popUntilElementPopped ( formattingElementEntry . element ) ; p . activeFormattingElements . removeEntry ( formattingElementEntry ) ; } return furthestBlock ; }
Steps 9 and 10 of the algorithm
Steps 9 and 10 of the algorithm