sudo apt install php-tidy
turns this:
<html><body><p>your HTML code here</p></body></html>
into this:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>
your HTML code here
</p>
</body>
</html>