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

Entity too large / Local Tidy not working #22

Closed asvetlovsky closed 11 years ago

asvetlovsky commented 12 years ago

I absolutely love HTML Tidy in SublimeText. For the most part it works really well. However, recently with larger files I've been getting the following error: urllib2.HTTPError: HTTP Error 413: Request Entity Too Large

I'm guessing that's because it sends the HTML to a server to be tidied before coming back to SublimeText. To get around that, I've tried to install a local copy of PHP5 with Tidy. However, I'm getting the following message in the console: HTMLTidy: Checking PHP Tidy module... HTMLTidy: Your PHP version doesn't include Tidy support

Going to a command line and typing 'php -m' will list tidy as one of the loaded extensions.

Is there a way to get it to use the local PHP, or for the external server to allow larger files?

fitnr commented 12 years ago

This is a good point. I will work on support for an option to force the use of the php version.

asvetlovsky commented 12 years ago

Great to hear quick feedback. Thanks for looking into it.

welovewordpress commented 11 years ago

@asvetlovsky regarding the "HTTP Error 413: Request Entity Too Large" error from the webservice:

This was mod_security which allowed only little more than 100k of html to be uploaded... I've just increased this limit to 1MB. You think that's enough?

asvetlovsky commented 11 years ago

@welovewordpress The files I was trying to tidy were about 250k, and I could see them possibly getting a bit bigger in the future (maybe 350-400... maybe). 1MB should be plenty for my use case for a very long while.

asvetlovsky commented 11 years ago

I've just started testing out the new limit, however I'm still getting an Entity Too Large error. It now opens in a new tab with the following info:

Had a problem communicating with the webservice: HTTP Error 413: Request Entity Too Large ['webservice', '--tab-size', '4', '--clean', '1', '--doctype', 'strict', '--new-blocklevel-tags', 'section,header,footer,hgroup,nav,dialog,datalist,details,figcaption,figure,meter,output,progress', '--new-inline-tags', 'video,audio,canvas,source,embed,ruby,rt,rp,keygen,menu,command,time', '--new-pre-tags', 'article,aside,summary,mark', '--output-html', '1', '--output-xhtml', '0', '--output-xml', '0', '--show-body-only', '1', '--break-before-br', '0', '--indent', '1', '--indent-attributes', '0', '--indent-spaces', '4', '--tab-size', '4', '--wrap', '0', '--wrap-attributes', '0', '--quiet', '1']

Edit: The file in question is a 144k HTML file saved from Word (I know, I know... out of my hands, hence the HTML Tidy).

fitnr commented 11 years ago

I have a working draft of changes to create an option force the use of php or tidy.exe. The issue is that on OS X, the bundled version of PHP has an older version of libTidy, which makes the change useless for users on OS X.

jandahl commented 11 years ago

Using fink to install a new version of tidy-dev might help? Currently on 1:051026-6. http://pdb.finkproject.org/pdb/package.php/tidy-dev

I just installed it but it does not seem to alleviate the immediate problem, but that might be one of setting the plugin to point at the correct version?

asvetlovsky commented 11 years ago

Has there been any movement on this issue? I'm still getting the urllib2.HTTPError: HTTP Error 413: Request Entity Too Large error on large html files.

wp-lab commented 11 years ago

the webservice should accept html up to 1MB now.