welovewordpress/SublimeHtmlTidy — pull request #11 by fitnr (2012-07-12 00:23:32+00:00)
Title: Refactoring and updates for speed

I've changed the tidy function to use the STDIN and STDOUT pipes on both the python and PHP sides. This eliminates the need for tmp files and speeds up the function.

On the PHP side, the native getopt() function is now used to parse options.

I also eliminated the function that checked the passed values against Tidy's defaults. My thinking is that Tidy is pretty good about ignoring options that match its defaults. I apologize for being bold if I missed something.

Most importantly, and the real reason I made changes at all: I added support for multiple selections. Selecting just a portion of a document now enables the `--show-body-only option`, so no ``, `` or `

` tags are added.

I've tried this on both Mac and Windows, and it works for me. I haven't tested the error handling extensively.