protected function unwrap(DOMElement $embed)
    {
        $link = $embed->parentNode;
        $childCount = 0;

        /** @var \DOMText|\DOMElement $node */
        foreach ($link->childNodes as $node) {
            if (!($node->nodeType === XML_TEXT_NODE && $node->isWhitespaceInElementContent())) {
                ++$childCount;
            }
        }

        if ($childCount === 1) {
            $link->parentNode->replaceChild($embed, $link);
        }
    }
protected function unwrap(DOMElement $embed)
    {
        $link = $embed->parentNode;
        $childCount = 0;

        /** @var \DOMText|\DOMElement $node */
        foreach ($link->childNodes as $node) {
            if (!($node->nodeType === XML_TEXT_NODE && $node->isWhitespaceInElementContent())) {
                ++$childCount;
            }
        }

        if ($childCount === 1) {
            $link->parentNode->replaceChild($embed, $link);
        }
    }
protected function unwrap ( DOMElement $ embed ) { $ link = $ embed -> parentNode ; $ childCount = 0 ; /** @var \DOMText|\DOMElement $node */ foreach ( $ link -> childNodes as $ node ) { if ( ! ( $ node -> nodeType === XML_TEXT_NODE && $ node -> isWhitespaceInElementContent ( ) ) ) { ++ $ childCount ; } } if ( $ childCount === 1 ) { $ link -> parentNode -> replaceChild ( $ embed , $ link ) ; } }
Unwraps embed element in the case when it is single content of its link.

The above should always be the case for block level embed after Expanding conversion pass.
If embed (inline) is not the single content of its link, it won't be unwrapped and link
parameters on the embed will signify this with 'wrapping' parameter set to true (done later
in EzLinkToHtml5 converter).

@param \DOMElement $embed
Unwraps embed element in the case when it is single content of its link .