As I stated previously, the Tidy library comes equipped with another useful function, named "tidy_clean_repair()," which behaves in a manner nearly identical to the "cleanRepair()" method demonstrated in the section that you just read. In this case, this brand new function will fix any badly-formatted (X)HTML markup, and its usage is illustrated by the following example: // example of 'tidy_clean_repair()' function /* displays the following: As you can see, using the above "tidy_clean_repair()" function is indeed a very straightforward process, since the function in question performs a clean-up task on a specified (X)HTML string, certainly behaving identically to its cousin "cleanRepair()" method. Additionally, when it comes to correcting the format of a specific (X)HTML string, the Tidy library also offers the neat "tidy_repair_string()" function, which can be used as indicated below: // example of 'tidy_repair_string()' function /* displays the following: So far, so good, right?. At this point you've hopefully learned how to use a few useful functions included with the Tidy library to format correctly a particular (X)HTML string. Nevertheless, as you might have guessed, Tidy has plenty of neat functions when it comes to fixing badly-formatted markup. Thus, keeping in mind this important fact, in the section to come I'm going to show you how to use the excellent functionality provided by the Tidy extension to parse, and eventually correct, the format of different (X)HTML files. As you know, this brand new Tidy feature will be covered in the next few lines, so click on the link that appears below and keep reading.
blog comments powered by Disqus |