-
Notifications
You must be signed in to change notification settings - Fork 429
Nested a tags should be an error? #307
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 reporting... it certainly looks like a bug has crept in ;=(( Running very close to your exact sample, my local only Running it through tidy-cvs (circa 2009) will yield -
And the output will be corrected to -
Note I added one space between I too have trouble deciphering W3C documents, fully understanding, so will let others comment on that. But I too note the W3C validator also flags an In fact I now note we have an existing regression test for this! Test 427827. However this does not flag a problem because someone, probably me!, has put the nested anchor output in There are some clues in the text of the above bug report, and I hope to use them to again fix 2015 tidy, unless someone else beat me to it with a PR or patch, or cites W3C documentation that specifically allows nested anchors. |
@benkasminbullock have found a fix for this... Essentially the 23 Aug 00 427827 bugs/28 fix copied from ParseInline(), which used to handle anchors, and still does if the document has a legacy html4-- doctype, to ParseBlock(), which now handles anchors in html5++ mode, but will hold off pushing a few more days in case someone can cite W3C documentation that specifically allows nested anchors. But all my W3C reading so far on anchors indicates they represent a This fix also includes changing the The current full diff can be found at http://geoffair.org/tmp/issue307.diff if you want to try it meantime... |
Well it says right at the bottom of the link you've given here: http://sourceforge.net/p/tidy/bugs/53/ Dave Raggett responded on 03 Jan 2001 : I need to ensure that nested anchors are detected as these aren't legal in HTML or XHTML. This involves a special check which I suspect is missing. I will add this to the list of things to look at for the next release. Since Dave Raggett actually wrote one of the HTML specifications, I don't think this is really worth worrying about. |
@benkasminbullock hmmm, and assuming the spec has not changed in nearly 15 years since that post ;=)) The reason this bug re-arrived was due to a HTML5 change in the content of an anchor. Previously it only allowed But I have now found in a relatively recent document a.html a clear statement So have pushed this change to Hope you get a chance to pull, test, and close this if fixed... thanks... |
@benkasminbullock no further comments in nearly 3 weeks, so assume this can be closed? Please feel free to re-open, or open a new issue... thanks. |
At the moment a document of this type:
does not produce errors using tidy 5.0.0. However, most online validators give an error with the double a tag above. I cannot decipher the HTML specification as to which is correct.
The text was updated successfully, but these errors were encountered: