welovewordpress / SublimeHtmlTidy

Tidy, clean and prettify your HTML code with this plugin for Sublime Text 2
GNU General Public License v2.0
88 stars 15 forks source link

No indentation with default settings #15

Closed jflorez closed 12 years ago

jflorez commented 12 years ago

Hi, I just installed the HtmlTidy package on my Sublime Text 2 (Mac OS X Mountain Lion) and when I run "Tidy HTML" the HTML gets processed but there is no indentation.

HtmlTidy.sublime-settings has the default configuration with

// This option specifies if Tidy should indent block-level tags "indent": "auto",

//This option specifies the number of spaces Tidy uses to indent content "indent-spaces": "2",

Thanks for your help

welovewordpress commented 12 years ago

@jflorez I just fixed a problem passing parameters to the tidy.php script. That should fix the problem.

Sorry for the late response, but others (@fitnr) made some changes (more like "rewrote the whole code according to python best practices") and I had to wrap my head around what he did first... I stil wonder how he could have missed that bug, which didn't just make identation dissappear but disabled each and every setting from the settings file.

Oh, and I'll make 4 chars the default again.

fitnr commented 12 years ago

Oops. My version must have been relying on the settings file in my user directory. Boneheaded.

welovewordpress commented 12 years ago

Hi @fitnr,

ah... I didn't test it with a user settings file, but that explains why it was working on your machine.

Could you please answer me one more question: Why exactly did you make the php version the first choice over the native tidy?

I just remembered that I did prefer the native version over the php version because if the native version is found, the plugin will just work. But if php can be "found", it still could be an older version without the required "Tidy" class built in.

So basically if people have problems running the plugin, it should just be "apt-get install tidy" and you're done. Windows binary is included, OSX binary has been included with the OS since some years now.

If you have any valid reason, why the php version might be preferable please tell me. Otherwise I would revert that change back to making the native version the first choice.

see issue #14 - he has just confirmed that even php 5.3 can come without "Tidy" class.

fitnr commented 12 years ago

I suggest that this issue can now be closed.

jflorez commented 12 years ago

Tidy execution broke when there is selected text. I change the body only settings to "auto" in to fix it.

Thanks for the work in this

jflorez commented 12 years ago

Also on the latest version of tidy(2009) for mac os x, the settings should no include a "=" before the settings value

welovewordpress commented 12 years ago

as of right now, the native version is deprecated and the plugin will use a web service if your local php doesn't meet the requirements.

please update to the latest version and if you still have some issues, please open a new issue.

jflorez commented 12 years ago

Thanks, great plugin, and thanks for the fixes