Over the last two week-ends I have worked at an adaptation of HTMLTidy to use PHP's tidy module rather than the tidy executable.

The code is still a bit rough but it might be good enough to share. Not sure whether you might be interested to incorporate it in HTMLTidy or not. To avoid confusion, I have used a different file name and module name.

CommentFileSizeAuthor
#2 phptidy.zip5.25 KBandres@baravalle.it
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michaelfavia’s picture

Status: Patch (to be ported) » Needs work

attachment missing?

andres@baravalle.it’s picture

FileSize
5.25 KB

Yes, attachment missing... Sorry, here is it.

andres@baravalle.it’s picture

hi, did you have the chance to look at the code?

gravisrs’s picture

Piece of good work Andres! Well done, your module works like a charm.

reezy’s picture

Hello, I've been having some trouble getting this module to work.
I added the .module and .info files to a PHPtidy folder in my Modules directory. I then enabled the module from the site.
Would anyone be able to tell me how I can configure the tidy options. Specifically I would like to set "clean: true", but I do not know where to save my configuration file.

michaelfavia’s picture

Id actually liek to base the module on the PECL tidy extension instead of the binary now that drupal has a git based VCS system i can actually work on this thing without going mad. I might make the swtich this week. ill leave the 1.x version in maintenance mode and port this to 2.x, need ot look into 7.x support as well.

colan’s picture

Title: Using PHP tidy module » Use PHP's Tidy bindings instead of the executable
Version: 6.x-1.x-dev » 7.x-1.x-dev

Needs to go into 7 first. Here's a link to the documentation: PHP: Tidy.

EDIT: Bonus points if you can get it to work with the experimental HTML5 version! :)