W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2000

the -m switch (was: Bugs/suggestions)

From: Peter Evans <evans@i.hosei.ac.jp>
Date: Tue, 15 Feb 2000 12:45:34 +0900
Message-Id: <200002150347.MAA00336@ns.i.hosei.ac.jp>
To: html-tidy@w3.org
Hello all.  This is the first time I've spoken up here.  And I'm pretty new
even as a lurker, so apologies if I'm retreading old ground with what follows.

Just one (amateurish) comment on a couple of aspects of Matthew Brealey's list
of putative bugs.

> Thus, where I have
> <p>
> Some <b>bold text -  accidentally missed off the '</b>'
> </p>,
> it thinks that I wanted the boldness to span the whole of the rest of the
> document, and as a result I have to manually remove the hundreds of tags
> it adds (on one particularly extreme occasion it converted one of my (very
> complex and difficult to recreate) test pages into a whole load of <PRE>
> elements, and because of restrictions on the elements that can occur
> within <PRE> applied my style declarations on <BR> thereby destroying
> several hours of work).

I'm not sure whether or not this is a bug in Tidy.  Whether it is or isn't, my
mind boggles at the idea of somebody who's clearly no novice running a utility
whose results are as radical as Tidy's to overwrite a file without first making
a backup.  Surely a better way is to make a backup, or, better still, to avoid
the -m switch and instead get Tidy to create a second file (which is what I
always do).

However, I have to say that Dave Raggett's explanation (or the 13 January
version) is slightly to blame, in that it does the extreme opposite of treating
Tidy users like morons.  He writes:

    I generally use the -m option to get tidy to update the
    original file. . . .

He may be wise to do that, but if so it's for the very simple reason that his
ability to write decent HTML is way above that of Joe Schmoe web-page writer
(e.g. myself).  I'd strongly suggest rewording this bit along the following

    If you're pretty sure that your page has only the most minor
    imperfections, or if you've made a backup copy, you might
    use the -m option to get tidy to update the original file.
    But remember that tidy may work in a very unexpected 
    way, producing something quite unlike what you intended.
    So I suggest that you redirect output to a second file.
    and only discard the old file when you're sure you like the
    newer one.  If you're using the Windows/MS-DOS command
    line, you'd need to write something like 

    tidy -c config.txt dirtyold.htm >cleannew.htm

(NB most of us Wintel-using dumbos have either forgotten what "input and output
default to stdin and stout respectively" means, or never learnt it in the first
Peter Evans evans@i.hosei.ac.jp
Received on Monday, 14 February 2000 22:47:26 UTC

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