Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

AbstractHtmlProcessor::renderBodyContentpublicWC 1.0

Renders the content of the BODY element of the normalized and processed HTML.

Method of the class: AbstractHtmlProcessor{}

No Hooks.

Returns

String.

Usage

$AbstractHtmlProcessor = new AbstractHtmlProcessor();
$AbstractHtmlProcessor->renderBodyContent(): string;

AbstractHtmlProcessor::renderBodyContent() code WC 10.7.0

public function renderBodyContent(): string
{
    $htmlWithPossibleErroneousClosingTags = $this->getDomDocument()->saveHTML($this->getBodyElement());
    $bodyNodeHtml = $this->removeSelfClosingTagsClosingTags($htmlWithPossibleErroneousClosingTags);

    return (new Preg())->replace('%</?+body(?:\\s[^>]*+)?+>%', '', $bodyNodeHtml);
}