-
Notifications
You must be signed in to change notification settings - Fork 429
XHTML5 wrongly recognized as XHTML 1.0 Transitional #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, that looks true. Tidy didn't detect any features specific to XHTML5, so it defaults to the lowest possible version. We should look at the missing DTD and realize that it can't be less than XHTML5. When the meta is added, as you indicate, a flag is set indicating (X)HTML5, and so the lowest possible version becomes HTML5 and reports correctly. On the other hand, that message is an "informational message" ( PR's to fix are welcome. |
Well it does affect warnings at the very least, especially when you take #377 into account:
Whereas:
(As a matter of fact, I came across this bug while struggling with #377. It took me a while to figure out why the |
@dechamps thanks for the issue... as #377 and @balthisar point out, tidy's guess of the type of document is exactly that, a guess, and is done by eliminating There is a cmake option, And one of these outputs, also written to a log file for later review, is showing how certain It will show, a diminishing bit list, as each feature is found, like -
Now using your sample, and running my Debug
Note the addition of the
And this can then change the warnings, and/or errors, found and reported, as you have discovered... Now that But more or less as you suggest, it could be improved to take account of the Look forward to further feedback, patches, or a PR to achieve this... thanks... |
Thanks for the explanation. I think what would make the most sense is if tidy sees |
@dechamps thanks for the further feedback on this... did some more testing...
Some of this makes good sense, and going back into the past legacy The following is the results of running tidy on a simple document as follows - <!DOCTYPE "various">
<html>
<head>
<title>Issue #657-6</title>
</head>
<body>
<p>HTML 5</p>
</body>
</html> Each with the doctype header shown, the Input: input5\in_657-2.html Info: Doctype given is "-//W3C//DTD XHTML Basic 1.0//EN"
Info: Document content looks like XHTML Basic 1.0
No warnings or errors were found.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
After : HT20|HT32|H40S|H40T|----|H41S|H41T|----|X10S|X10T|----|XH11|XB10|----|HT50|XH50 Input: input5\in_657-3.html Info: Doctype given is "-//W3C//DTD HTML 3.2//EN"
Info: Document content looks like HTML 3.2
No warnings or errors were found.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
After : HT20|HT32|H40S|H40T|----|H41S|H41T|----|X10S|X10T|----|XH11|XB10|----|HT50|XH50 Input: input5\in_657-4.html
Input: input5\in_657-5.html
So we can see in every case, tidy used to When it came to using Input: input5\in_657-6.html
Note each of those input test files are in my test repo... Now what this shows is that the choice of the Right now I am way back at I do not fully understand One of the most frequent calls is from First the Then it calls But the results of As indicated I have tried many times in the past to get my head around all this, and am still coming up short... So I am not sure it is as simple as using the existence of But I am sure But do agree with the presence of Sorry I seem to be raising more questions than answers here! Even bringing into question exactly what does this Will continue to look at this, explore, experiment, but meantime seek further feedback, ideas, comments, even test patches or PR... thanks... |
On current HEAD (f0438bd):
Reports:
Even though the document is quite obviously XHTML5, with the XML preamble combined with
<!DOCTYPE html>
and thexmlns
attribute being dead giveaways.Weirdly enough, the document is correctly recognized as XHTML5 if the following is added:
The text was updated successfully, but these errors were encountered: