Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor
AbstractHtmlProcessor::prepareHtmlForDomConversion
Returns the HTML with added document type, Content-Type meta tag, and self-closing slashes, if needed, ensuring that the HTML will be good for creating a DOM document from it.
Method of the class: AbstractHtmlProcessor{}
No Hooks.
Returns
String. the unified HTML
Usage
// private - for code of main (parent) class only $result = $this->prepareHtmlForDomConversion( $html ): string;
- $html(string) (required)
- .
AbstractHtmlProcessor::prepareHtmlForDomConversion() AbstractHtmlProcessor::prepareHtmlForDomConversion code WC 10.5.0
private function prepareHtmlForDomConversion(string $html): string
{
$htmlWithSelfClosingSlashes = $this->ensurePhpUnrecognizedSelfClosingTagsAreXml($html);
$htmlWithDocumentType = $this->ensureDocumentType($htmlWithSelfClosingSlashes);
return $this->addContentTypeMetaTag($htmlWithDocumentType);
}