protected preprocess ( string $html ) : string | ||
$html | string | HTML fragment |
Результат | string | Processed HTML document |
protected function preprocess($html)
{
$content_type = 'text/html';
$ret = '<!DOCTYPE html>';
$ret .= '<html><head>';
$ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />';
$ret .= '</head><body>' . str_replace("\r", '', $html) . '</body></html>';
return $ret;
}