I have HTML that looks like this when you view the source:
Original HTML
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
But after I do:
$dom = new DOMDocument();
$dom->loadHTML($html);
$dom->saveHTML();
My source code turns to this:
New HTML
<!DOCTYPE html><html><head></head><body></body></html>
How can I preserve new lines and white space when using the PHP DOMDocument() class and its methods?