W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2004

RE: tidy: request for enhancement: empty lines between block-level elements

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Fri, 12 Nov 2004 11:33:39 -0500
To: <html-tidy@w3.org>
Cc: "'Amelia A Lewis'" <amyzing@talsever.com>
Message-ID: <000601c4c8d5$5e202250$6501a8c0@blackie>

[courtesy of Dave Raggett's forward to the html-tidy list...]

Arnaud Desitter wrote:
>> On Thu, 11 Nov 2004, Amelia A Lewis wrote:
>>> Rather than listing tags which would deserve this treatment, I'd
>>> suggest that all block level elements be optionally spaced in this
>>> fashion.  This would likely produce some oddities, but for the
>>> most part, it would help me immensely, in using tidy for cleanup.

> Have you tried "--vertical-space yes" ?

Or "--indent auto"?

Given this input (test.html):

  <h2 class="wotsis">header</h2>
  <p>lorem ipsum dolor est.</p>
  <p>and then some.</p>

and this config file[1] (tidy.cfg):

  doctype: strict
  output-xhtml: yes
  add-xml-decl: no
  indent: auto
  wrap: 76
  char-encoding: ascii
  ascii-chars: no
  clean: no
  drop-font-tags: yes
  logical-emphasis: yes
  drop-empty-paras: yes
  tidy-mark: no
  enclose-text: yes
  enclose-block-text: yes
  force-output: yes

with this command line:

  tidy -config tidy.cfg test.html

emits this:

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

  <html xmlns="http://www.w3.org/1999/xhtml">

    <h2 class="wotsis">header</h2>

    <p>lorem ipsum dolor est.</p>

    <p>and then some.</p>

If you don't want that indentation (as above), use Arnaud's suggestion of
the "vertical-space" option.  I.e., replace "indent: auto" with
"vertical-space: yes" in your config file.

Also it's *generally* advisable to be using a recent version of Tidy from


[1]: See http://tidy.sourceforge.net/docs/quickref.html  (Note the sample
config file I gave above has many superfluous options to what was needed for
your case: it was just a quick paste of one I use.)
Received on Friday, 12 November 2004 16:33:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:55 UTC