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

Limit which tags wrap to own lines? #24

Open smlombardi opened 11 years ago

smlombardi commented 11 years ago

It seems a bit of a waste of space to have some tags like option (in select menus) waste 3 lines for each option item (since the opening tag, value, and closing tag are each put on own line).

Is there and way to specify which tags should do this and which don't?

fitnr commented 11 years ago

Setting "indent":false in your User HtmlTidy.sublime-settings file will result in far less indentation and fewer lines.

smlombardi commented 11 years ago

There's no way to specify which tags? In BBEdit, there's a Source.profile file you can edit to specify how to hand each tag, as in break before, break after and/or break inside.

On Mon, Oct 15, 2012 at 1:19 PM, Neil Freeman notifications@github.comwrote:

Setting "indent":false in your User HtmlTidy.sublime-settings file will result in far less indentation and fewer lines.

— Reply to this email directly or view it on GitHubhttps://github.com/welovewordpress/SublimeHtmlTidy/issues/24#issuecomment-9453408.

fitnr commented 11 years ago

No, that feature doesn't exist. This package is a wrapper for libTidy. Adding this feature would require additions to libTidy. You may want to take a look at the tidy-html5 library, which is a fork of libTidy.

ricardozea commented 11 years ago

I found a temporary solution/workaround, you can read about it here: http://stackoverflow.com/questions/13143850/sublime-text-2-format-html-tags-content-in-one-line/13145975#13145975

As I said in that post, it's not ideal by any means, but...

Good luck

fitnr commented 11 years ago

I didn't know about reindent. It should be possible to call it within the plugin, and remove the need for the workaround.

ricardozea commented 11 years ago

Cool. Is this something you would incorporate in the plugin? Or is this something that 'welovewordpress' would do?

Also, why does HTMLTidy remove everything from the HTML file leaving only the markup that's inside the < body > tag?

Thanks.