tidy->repairString and repairFile

php.internals

Nuno Lopes

22 years ago
Hello, Today I was finishing writing the tidy docs and I've noted that the functions $tidy->repairString() and $tidy->repairFile() simply don't work! And I think these functions should be removed. I'll explain: non-OO way: <? echo tidy_repair_string($html); ?> OO way: <? $tidy = new tidy; var_dump($tidy->repairString($html)); echo $html; ?> The non-OO way is very simple, you give it a broken HTML and it returns a repaired HTML string. And in OO? It returns nothing! And why should you want that function in OO? tidy_repair_string() is a one-time use only function. Even if it exists in OO, you can't do anything with it (even if it worked...) Can you delete those funtions, please (isn't really the functions, just the OO mapping)? Thanks, Nuno

Andrey Hristov

22 years ago
Nuno Lopes wrote:
> Hello, > > Today I was finishing writing the tidy docs and I've noted that the > functions $tidy->repairString() and $tidy->repairFile() simply don't work! > And I think these functions should be removed. I'll explain: > > non-OO way: > <? > echo tidy_repair_string($html); > ?> > > OO way: > <? > $tidy = new tidy; > var_dump($tidy->repairString($html)); > echo $html; > > ?> > > The non-OO way is very simple, you give it a broken HTML and it returns a > repaired HTML string. And in OO? It returns nothing! And why should you want > that function in OO? tidy_repair_string() is a one-time use only function. > Even if it exists in OO, you can't do anything with it (even if it > worked...) > > Can you delete those funtions, please (isn't really the functions, just the > OO mapping)? > > Thanks, > Nuno >
Maybe John has to make this methods static and they will work just like the functions. Regards, Andrey

Nuno Lopes

22 years ago
> Maybe John has to make this methods static and they will work just like
the
> functions. > > Regards, > Andrey
Thats a good idea! But as we already have the non-OO function, I don't know if it worth to create the static methods. Nuno

Andrey Hristov

22 years ago
Quoting Nuno Lopes <nlopess@php.net>:
> > Maybe John has to make this methods static and they will work just like > the > > functions. > > > > Regards, > > Andrey > > > Thats a good idea! But as we already have the non-OO function, I don't know > if it worth to create the static methods. > Nuno >
For the purists out there :) andrey

John Coggeshall

22 years ago
On Sun, 4 Jul 2004, Nuno Lopes wrote:
> > Maybe John has to make this methods static and they will work just like > the > > functions.
As I just e-mailed Nuno, that's exactly what theyt should be (static methods). I've been away from e-mail for the past for days because of my move to NYC, but I'll take a look at it (assuming it hasn't already been fixed and I just haven't seen that e-mail yet). John