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

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

I regularly write documents in HTML format and need to confirm that
they're valid prior to publication. Thanks to the help of other
members of this group I was successful in configuring custom 'run' and
compile commands for files which have an ".html" extension. The 'run'
command simply opens the file in the nominated web browser. The
'compile' command runs 'tidy -e' against the file which does just what
I want and outputs errors and warnings about the file, including
position references as to where the errors occur (i.e. line and column
numbers).

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>

This is fantastic but I now want to be able to double click on each of
these lines and have Textadept navigate to the specified position. I
believe this is already configured for other compilation commands. So
far I have copied a section of the file "run_supplemental.lua" I
obtained from the wiki. When I run my custom 'compile' command,
Textadept gives the following error message:

/usr/share/textadept/modules/textadept/run.lua:113: attempt to index
local 'utf8_filename' (a nil value)

I guess the 'nil value' is a reference to the fact that the HTML Tidy
output doesn't give the name of the file, hence the 'run.lua' function
fails. The problem is that it appears that HTML Tidy simply doesn't
offer an option of including the file's name (or path) in its output.
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?

--
Received on Thu 20 Jan 2011 - 07:10:17 EST

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