Warin / SublimeTidyHTML

Cleanup you html files with SublimeTidyHTML. Parse your files with W3C's tidy-html5 locally. No php required nor webservice call.
20 stars 4 forks source link

Do not Tidy Empty Tags #5

Open uberbuilder opened 11 years ago

uberbuilder commented 11 years ago

I'm working with a static HTML site generator and I need to see the empty tags that it generates for my own purposes. Can we provide a configuration to turn this off?

Warin commented 11 years ago

There is an option in Tidy to leave those tags: you can add ,{"drop-empty-elements":"no"} in your User/TidyHTML.sublime-settings file

See this option and all the available settings here http://w3c.github.com/tidy-html5/quickref.html#drop-empty-elements

uberbuilder commented 11 years ago

@Warin Thank you for the advice, for some reason the setting is not sticking and now Tidy doesn't do anything... I'll play with this later on today to solve it... and I'll come back here and post the results. Thank you so much for pointing me in the right direction. Once I've solved the problem I'll make sure to come back and command/close the issue.

Warin commented 11 years ago

Try to upload to the latest version (using the command palette). You need to adapt your Packages/User/TidyHTML.sublime-settings file according to the default one Packages/TidyHTML5/TidyHTML.sublime-settings

If it still doesn't work, you can paste me your settings file

Warin commented 11 years ago

@uberbuilder did you manage to test with the latest version?

adamgoose commented 11 years ago

My TidyHTML.sublime-settings file looks like this.

{
  "TidyHTML":{
    "options":[
      {"indent":"yes"}
      ,{"indent-spaces":"2"}
      ,{"wrap":"0"}
      ,{"drop-empty-elements":"false"}
    ],
    "filetypes":[".html",".htm",".php"]
  }
}

And I am receiving the errors Config: unknown option: drop-empty-elements and Error: Can't open "false".

I have tried substituting the value for drop-empty-elements to no, 0, and even all of these without quotes. Still no luck. This one's killing me! >< I have version 2013.03.07.16.19.08.

Warin commented 11 years ago

Apparently it's an issue of installation path as described here: https://github.com/w3c/tidy-html5/issues/73

Can you check your setup?