Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get HTML Tidy to not put newline before closing tags?

HTML Tidy has this infuriating habit of putting a newline before the closing tag. For example:

<p>Some text</p>

becomes

<p>Some text
</p>

How do I tell Tidy to keep the closing tag on the same line as the end of the content?

Btw, I am running Tidy through Notepad++, if that makes any difference.

like image 688
markvgti Avatar asked Mar 22 '10 11:03

markvgti


1 Answers

Make sure vertical-space is set to no. After much frustration I learned the only thing that switch does is screw up your already somewhat-nicely formatted html by adding newlines where you don't want them.

This is what I use for minimally-invasive tidying (no adding doctypes/head tags, etc.):

tidy -mqi --doctype omit --show-body-only true --show-warnings no --vertical-space no --wrap 0

like image 111
Jonathan Dumaine Avatar answered Sep 22 '22 05:09

Jonathan Dumaine