A question about Tidy's validate
Liu hf <[email protected]> Thu, 13 Dec 2012 14:28:34 +0800
| Newsgroups | gmane.comp.web.html-tidy.devel |
|---|---|
| Message-ID | <CAKvPp3r73GTS2b64NSnAKJ6Agk3=wrC9MHje9Wns8=spxZ5B1Q@mail.gmail.com> |
--===============6190693608566013354==
Content-Type: multipart/alternative; boundary=047d7b15af1f3f755404d0b606be
--047d7b15af1f3f755404d0b606be
Content-Type: text/plain; charset=ISO-8859-1
I had a python script as fellow:
from tidylib import tidy_document
document, errors = tidy_document('''
<html>
<head>
<p>dfdfdfd
</httml/>
''')
print document
print errors
It is a incorrect html code , but when I run it , tidy fixed the mistake
automatically and did not print any error :
E:\script\py\dom>checkdom.py
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<p>
dfdfdfd
</p>
</body>
</html>
line 2 column 9 - Warning: missing <!DOCTYPE> declaration
line 4 column 25 - Warning: inserting implicit <body>
line 5 column 9 - Warning: discarding unexpected </httml>
line 3 column 17 - Warning: inserting missing 'title' element
I hope that tidy will print the errors when it is find the error
as unclosed tags, missing elements . Would you like to tell me how to do
it ? thank u so much .
Best Regards
--047d7b15af1f3f755404d0b606be
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<blockquote type=3D"cite" style=3D"color:rgb(34,34,34);font-family:arial,sa=
ns-serif;font-size:14px;background-color:rgb(255,255,255)"><blockquote type=
=3D"cite"><font face=3D"arial, helvetica, sans-serif" style=3D"color:rgb(80=
,0,80)"><span style=3D"font-size:15px">I =A0had a python script =A0as fello=
w:<br>
<br></span></font><span style=3D"font-size:15px;font-family:arial,helvetica=
,sans-serif">from tidylib import tidy_document</span></blockquote><blockquo=
te type=3D"cite"><font face=3D"arial, helvetica, sans-serif"><div style=3D"=
font-size:15px">
<div><font>document, errors =3D tidy_document('''</font></div><=
div style=3D"color:rgb(80,0,80)"><font color=3D"#3333ff"><span style=3D"whi=
te-space:pre-wrap"> </span><html></font></div><div style=3D"color:rgb=
(80,0,80)">
<font color=3D"#3333ff"><span style=3D"white-space:pre-wrap"> </span><he=
ad></font></div><div style=3D"color:rgb(80,0,80)"><font color=3D"#3333ff=
"><span style=3D"white-space:pre-wrap"> </span><p>dfdfdfd</font></div=
><div style=3D"color:rgb(80,0,80)">
<font color=3D"#3333ff"><span style=3D"white-space:pre-wrap"> </span></h=
ttml/></font></div><div><font>''')</font></div><div>print do=
cument</div><div><font>print errors</font></div></div><div style=3D"color:r=
gb(80,0,80);font-size:15px">
<br></div><div style=3D"color:rgb(80,0,80);font-size:15px">It is a incorrec=
t html code , but when I =A0run it =A0, tidy fixed =A0the mistake automatic=
ally and did not print any error :</div><div style=3D"color:rgb(80,0,80);fo=
nt-size:15px">
<br></div><div style=3D"color:rgb(80,0,80)"><div><span style=3D"font-size:1=
5px"><font color=3D"#3366ff">E:\script\py\dom>checkdom.py</font></span><=
/div><div><span style=3D"font-size:15px"><font color=3D"#3366ff"><!DOCTY=
PE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"</font></span></=
div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff">=A0 =A0 "<=
a href=3D"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target=3D"_bla=
nk" style=3D"color:rgb(17,85,204)">http://www.w3.org/TR/xhtml1/DTD/xhtml1-s=
trict.dtd</a>"></font></span></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff"><html xmlns=
=3D"<a href=3D"http://www.w3.org/1999/xhtml" target=3D"_blank" style=
=3D"color:rgb(17,85,204)">http://www.w3.org/1999/xhtml</a>"></font>=
</span></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff">=A0 <head>=
;</font></span></div><div><span style=3D"font-size:15px"><font color=3D"#33=
66ff">=A0 =A0 <title></title></font></span></div><div><span sty=
le=3D"font-size:15px"><font color=3D"#3366ff">=A0 </head></font></spa=
n></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff">=A0 <body>=
;</font></span></div><div><span style=3D"font-size:15px"><font color=3D"#33=
66ff">=A0 =A0 <p></font></span></div><div><span style=3D"font-size:15=
px"><font color=3D"#3366ff">=A0 =A0 =A0 dfdfdfd</font></span></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff">=A0 =A0 </p&=
gt;</font></span></div><div><span style=3D"font-size:15px"><font color=3D"#=
3366ff">=A0 </body></font></span></div><div><span style=3D"font-size:=
15px"><font color=3D"#3366ff"></html></font></span></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff"><br></font></sp=
an></div><div><span style=3D"font-size:15px"><font color=3D"#3366ff">line 2=
column 9 - Warning: missing <!DOCTYPE> declaration</font></span></di=
v><div>
<span style=3D"font-size:15px"><font color=3D"#3366ff">line 4 column 25 - W=
arning: inserting implicit <body></font></span></div><div><span style=
=3D"font-size:15px"><font color=3D"#3366ff">line 5 column 9 - Warning: disc=
arding unexpected </httml></font></span></div>
<div><span style=3D"font-size:15px"><font color=3D"#3366ff">line 3 column 1=
7 - Warning: inserting missing 'title' element</font></span></div><=
/div><div style=3D"color:rgb(80,0,80);font-size:15px"><br></div><div style=
=3D"color:rgb(80,0,80);font-size:15px">
<br></div><div style=3D"color:rgb(80,0,80);font-size:15px">=A0I hope that t=
idy will print the errors when it is find the error as=A0unclosed tags, mis=
sing elements =A0. Would you like to tell me how to do it ? =A0thank u =A0s=
o much =A0.</div>
<div style=3D"color:rgb(80,0,80);font-size:15px"><br></div><div style=3D"co=
lor:rgb(80,0,80);font-size:15px">Best Regards</div></font></blockquote></bl=
ockquote>
--047d7b15af1f3f755404d0b606be--
--===============6190693608566013354==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
--===============6190693608566013354==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Tidy-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tidy-develop
--===============6190693608566013354==--