@@ 828-843 (lines=16) @@ | ||
825 | if ($newDocument->getIsDOMDocumentCreatedWithoutPTagWrapper()) { |
|
826 | // Remove <p>-element, preserving child nodes. |
|
827 | $pElement = $newDocument->getDocument()->getElementsByTagName('p')->item(0); |
|
828 | if ($pElement instanceof \DOMElement) { |
|
829 | $fragment = $newDocument->getDocument()->createDocumentFragment(); |
|
830 | ||
831 | while ($pElement->childNodes->length > 0) { |
|
832 | $tmpNode = $pElement->childNodes->item(0); |
|
833 | if ($tmpNode !== null) { |
|
834 | /** @noinspection UnusedFunctionResultInspection */ |
|
835 | $fragment->appendChild($tmpNode); |
|
836 | } |
|
837 | } |
|
838 | ||
839 | if ($pElement->parentNode !== null) { |
|
840 | $pElement->parentNode->replaceChild($fragment, $pElement); |
|
841 | } |
|
842 | } |
|
843 | } |
|
844 | ||
845 | // Remove <body>-element, preserving child nodes. |
|
846 | $body = $newDocument->getDocument()->getElementsByTagName('body')->item(0); |
|
@@ 847-862 (lines=16) @@ | ||
844 | ||
845 | // Remove <body>-element, preserving child nodes. |
|
846 | $body = $newDocument->getDocument()->getElementsByTagName('body')->item(0); |
|
847 | if ($body instanceof \DOMElement) { |
|
848 | $fragment = $newDocument->getDocument()->createDocumentFragment(); |
|
849 | ||
850 | while ($body->childNodes->length > 0) { |
|
851 | $tmpNode = $body->childNodes->item(0); |
|
852 | if ($tmpNode !== null) { |
|
853 | /** @noinspection UnusedFunctionResultInspection */ |
|
854 | $fragment->appendChild($tmpNode); |
|
855 | } |
|
856 | } |
|
857 | ||
858 | if ($body->parentNode !== null) { |
|
859 | $body->parentNode->replaceChild($fragment, $body); |
|
860 | } |
|
861 | } |
|
862 | } |
|
863 | ||
864 | // Remove head element, preserving child nodes. |
|
865 | if ( |