function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
    const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
    const { token } = formattingElementEntry;
    const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
    p._adoptNodes(furthestBlock, newElement);
    p.treeAdapter.appendChild(furthestBlock, newElement);
    p.activeFormattingElements.insertElementAfterBookmark(newElement, token);
    p.activeFormattingElements.removeEntry(formattingElementEntry);
    p.openElements.remove(formattingElementEntry.element);
    p.openElements.insertAfter(furthestBlock, newElement, token.tagID);
}
//Steps 15-19 of the algorithm
Steps 15-19 of the algorithm
Steps 15 - 19 of the algorithm
function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
    const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
    const { token } = formattingElementEntry;
    const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
    p._adoptNodes(furthestBlock, newElement);
    p.treeAdapter.appendChild(furthestBlock, newElement);
    p.activeFormattingElements.insertElementAfterBookmark(newElement, token);
    p.activeFormattingElements.removeEntry(formattingElementEntry);
    p.openElements.remove(formattingElementEntry.element);
    p.openElements.insertAfter(furthestBlock, newElement, token.tagID);
}
function aaReplaceFormattingElement ( p , furthestBlock , formattingElementEntry ) { const ns = p . treeAdapter . getNamespaceURI ( formattingElementEntry . element ) ; const { token } = formattingElementEntry ; const newElement = p . treeAdapter . createElement ( token . tagName , ns , token . attrs ) ; p . _adoptNodes ( furthestBlock , newElement ) ; p . treeAdapter . appendChild ( furthestBlock , newElement ) ; p . activeFormattingElements . insertElementAfterBookmark ( newElement , token ) ; p . activeFormattingElements . removeEntry ( formattingElementEntry ) ; p . openElements . remove ( formattingElementEntry . element ) ; p . openElements . insertAfter ( furthestBlock , newElement , token . tagID ) ; }
Steps 15-19 of the algorithm
Steps 15 - 19 of the algorithm