Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

AbstractHtmlProcessor::ensureDocumentTypeprivateWC 1.0

Makes sure that the passed HTML has a document type, with lowercase "html".

Method of the class: AbstractHtmlProcessor{}

No Hooks.

Returns

String. HTML with document type

Usage

// private - for code of main (parent) class only
$result = $this->ensureDocumentType( $html ): string;
$html(string) (required)
.

AbstractHtmlProcessor::ensureDocumentType() code WC 10.7.0

private function ensureDocumentType(string $html): string
{
    $hasDocumentType = \stripos($html, '<!DOCTYPE') !== false;
    if ($hasDocumentType) {
        return $this->normalizeDocumentType($html);
    }

    return self::DEFAULT_DOCUMENT_TYPE . $html;
}