Re: Problem using 'HTML Tidy' to detect errors in an HTML file

From: phayz <russelldicken....at.gmail.com>
Date: Thu, 20 Jan 2011 04:46:18 -0800 (PST)

On Jan 20, 10:35 pm, Robert <ro....at.web.de> wrote:
> On Thu, Jan 20, 2011 at 1:10 PM, phayz <russelldicken....at.gmail.com> wrote:
>
> [...]
>
> > Here's a sample of HTML Tidy's output:
> >> tidy -e "issue74_tobepublished.html"
> > line 1 column 1 - Warning: missing <!DOCTYPE> declaration
> > line 1 column 1 - Warning: inserting implicit <body>
> > line 114 column 1 - Warning: discarding unexpected </thead>
> > line 117 column 42 - Warning: inserting implicit <p>
> > line 118 column 55 - Warning: inserting implicit <p>
>
> [...]
> > Am I correct and this is why the custom 'compile' command is failing?
> > If not, where am I going wrong? Does anyone know of an alternate
> > method of validating HTML that I can use while offline *and* online?
>
> > --
> > Russell
>
> tidy has an option
>
> >gnu-emacs
> >Type: Boolean
> >Default: no
> >Example: y/n, yes/no, t/f, true/false, 1/0  
> >This option specifies if Tidy should change the format for reporting errors and warnings to
> >a format that is more easily parsed by GNU Emacs.
>
> e.g.: tidy -e --gnu-emacs 1 "issue74_tobepublished.html"
> should give you something that is more easily parsed like the already
> available examples.
>
> Robert

Thanks for such a prompt reply! I didn't know about this option. When
I was reviewing Tidy's list of options I was referring to the output
of "tidy -h", which doesn't seem to list the "emacs" option.

Anyway I just tested this option and its output is much more likely to
work with a custom Textadept 'compile' option. I added 'q' before the
'e' parameter so that I don't have the "advertising" at the end of the
validation output. Full credit to Tidy's authors but I really don't
need to see this every time.

I'll now see if I can adjust my custom 'compile' command.

--
Received on Thu 20 Jan 2011 - 07:46:18 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:58:48 EST