Pelago\Emogrifier\HtmlProcessor
AbstractHtmlProcessor::ensureDocumentType() private WC 1.0
Makes sure that the passed HTML has a document type.
{} It's a method of the class: AbstractHtmlProcessor{}
No Hooks.
Return
String. HTML with document type
Usage
// private - for code of main (parent) class only $result = $this->ensureDocumentType( $html );
- $html(string) (required)
- -
Code of AbstractHtmlProcessor::ensureDocumentType() AbstractHtmlProcessor::ensureDocumentType WC 5.0.0
private function ensureDocumentType($html)
{
$hasDocumentType = \stripos($html, '<!DOCTYPE') !== false;
if ($hasDocumentType) {
return $html;
}
return static::DEFAULT_DOCUMENT_TYPE . $html;
}