Tidy is installed, Gus. Note, it is
not
the tidy documented here. Since we're at 4.3.8, I guess. It is the tidy not really documented here.
I can verify that
<?php
$html = '<b><i>test</p></table>';
$tidy = tidy_repair_string($html);
print_r($tidy);
?>
this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
</head>
<body>
<b><i>test<br>
<br></i></b>
</body>
</html>
So we'd need to dial that down a wee bit.
Okay, I found the configuration -- and you can kinda use both docs, it seems.
$html = '<b><i>test</p></table>';
$config = array('show-body-only' => true);
$tidy = tidy_repair_string($html,$config);
gives
<b><i>test<br>
<br></i></b>
I would be interested in hearing how they finally got the damn thing installed, ita.
They got updated RPMs from Plesk that cleared up the system version inconsistencies, and then the compilations worked just like advertised.
My thinking is that after we've parsed the quickedits into HTML, we then pass the result through tidy -- making sure our parsing makes nice and compliant HTML.
In fact, with the tidy library, you can run it through and see if it has errors, and put a little tsk-tsk note where the poster can see it.
Or not -- it was an idea that amused me, but we're not here to teach HTML, especially if we can neatly recover from messes.
We could have it send a tsk-tsk note to the poster's profile email. ;)
Hee. God bless negative reinforcement.
Thanks, ita. I'm on it. Wrist-slap comments in the code shouldn't be much of a problem, actually. I can just dump this [link] output inside a comment block.
There has to be some point, though, where the input is sufficiently mangled that tidy can't deal with it, right?