-
Notifications
You must be signed in to change notification settings - Fork 429
Missing </head> doesn't generate error #327
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
@benkasminbullock, thanks for the report. Would you check to see if 5.1.28 provides the expected behavior? |
The branch seems to have been deleted. |
Sorry, I guess editing my comment wasn't fast enough. Actually look at master, which should be at 5.1.28 now. |
@balthisar fast work ;=)) @benkasminbullock I pulled 5.1.28 and now see a warning... guess we can close this... thanks... |
Thanks @geoffmcl and @balthisar. Since you've gone to the trouble of making this, it would be a nice if there was a test confirming both the insertion of and the production of the error message, so the work doesn't get undone later. I would provide one, but I am currently struggling to understand the testing scripts. |
@benkasminbullock well this was the simple addition of an error message, so not sure of the need for a test case, but maybe...
This is the main problem. The current testing procedure and scripts are not well documented, and mostly do not do what people think! In their present form they are certainly not any form of There are some 228 tests in test/input. Some are repeats which need to be pruned. Some were a segfault. Some can only be visually compared to decide pass or fail. Some are to compare the output. At present the tests only compare the exit code with an expected exit code. In most case that is not sufficient. As it turns out, this case could be detected by the current procedure in that previously the exit code was 0, now it is a 1. And that is all the scripts presently compare. Recently I did add a test/testbase folder which contains the expected output, thus could do a simple FWIIW I have been collecting a new set of tests, about 230 plus, since around Jan 2015, and for sure I added this case in that. In two forms - one without It would certainly be appreciated if someone were to take this up. Define a group of tests, clearly indicating what is tested. Prune, combine, fix, sort the current One suggestion by @vielmetti has been to use say travis-ci or the like - see #269 - We have rejected this automation in the past, but if the tests could be defined as in the above, fixed to specifically test something, then maybe it is time to reconsider this method... This |
Oops, found a simple case where this warning should not be issued when the following processed with Input:
Output:
And this sample code exposes another This is an old bug https://sourceforge.net/p/tidy/bugs/949/ posted 2014-03-01 by @Yvand, now moved here... |
I'm not sure what you're thinking about in terms of tests but just to get the ball rolling I've gathered a few github issues into a simple set of tests here: https://github.com/benkasminbullock/tidy-html5/tree/bkbtest You need to run the tests like this:
|
@benkasminbullock wow, thank you for the quick test... sort of a proof of concept... I have pulled and tried your branch in Window, and was pleasantly surprised that the perl install includes a There were some windows TIDY exe issues. Like the current test scripts maybe this can be externalized as an environment variable, TIDY, or something... there are times I need to test with other than the currently built tidy... I am particularly interested in how you will handle an output compare, where just testing the exit code is not sufficient? And can we not use, leverage, the files in I do have some other questions, concerns, but today is my very short computer day, so will get into that tomorrow, so do not suggest you put too much more time into this until I can reply... Again, really thank you for helping in this... Maybe this should all be moved to a new important issue? |
@benkasminbullock have moved the |
@benkasminbullock, @balthisar have now done the full regression tests, and this fix changes MANY message outputs! Of course it does not effect the html output, just the message output. There are many cases where the test sample does not have a doctype, head, or title. In the past tidy would only warn Typical change is -
This effects some 35 tests - 1050673 1056023 1062511 1063256 1072528 1210752 1266647 1398397 1408034 1415137 1603538-1 1603538-2 1632470 1707836 1715153 427836 427840 431874 431889 433666 435903 438956 441508 487204 511679 566542 620531 640473 647255 658230 676156 678268 765852 795643-1 795643-2 Further, in the following sample tidy does not report a missing
BTW that above sample passes the W3C validator! So why should tidy now start reporting a missing So this is not only a problem when the option I am all for reverting commit 61cfcb1! And close this issue with a statement like - "Yes, tidy does not warn about a missing Thoughts? |
Shouldn't it do that though?
I cannot reach the W3C validator at the moment to check this, but I don't think it should do that. A typical error in generated HTML files from templates is producing an error during the file generation and leaving off the
|
@benkasminbullock well I hope you get access to the W3C validator soon. Today it is one of the quick tests I always try to run, just to check what the validator says. If you "don't think it should do that" then file a bug on the validator, after you very carefully check the W3C documentation. While reading W3C specs often makes my head spin, this page on the-p-element makes it clear the end tag may be omitted in certain circumstances. And this is true for a number of elements... In tags.c there are some 39 elements with the Please check the validator... please read the documentation... please present a simple sample... before you suggest "this behaviour is not very consistent"! As it stands this is just speading FUD! And please remember it is not as simple as "what you think"! I still think reverting commit 61cfcb1 is the correct thing! Right now this is the inconsistent behaviour! |
Thanks for the insight @geoffmcl. The validator started working right after I wrote the above. I can confirm that it does not report errors, and neither does Tidy usually report about closing |
@balthisar it is your commit... can we revert it? |
We can, but no computer for me until Sunday night. You can find the commit? Sent from a mobile device.
|
@benkasminbullock @balthisar commit reverted, and version bumped to 5.1.31... Changed this from a bug to technical support on the tidy way ;=)) Assume this can be closed... |
The following HTML is missing
</head>
:Run with tidy dd4eb46, built from source, the output is this:
It's notable that there is no error message printed here although the
</head>
is inserted correctly. I would have expected an error message here.The text was updated successfully, but these errors were encountered: