-
Notifications
You must be signed in to change notification settings - Fork 429
Anchor duplication - block-level anchor issue? #167
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
@jacksonp yes, somehow this anchor tag got block and mixed added. Putting it back to just inline give the previous output... |
@jacksonp please pull version 4.9.18 if you get a chance, and re-test... thanks... |
@geoffmcl Thanks, that does stop the duplication issue, I now get this output: <!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 4.9.18">
<title>Test</title>
</head>
<body>
<h1><a id="Section" href="#Section">Section</a></h1>
</body>
</html> But anchor tags can go around block-level elements in html5, so I guess I should have said I was expecting the output to be the same as the input, so: <a id="Section" href="#Section"><h1>Section</h1></a> |
@jacksonp yes I reverted the behaviour because the duplication of the anchor looked very bad! Will now look for a way to allow the anchor to be around the block if html5... thanks for the quick testing and report... |
Revert TidyTag_A to HTML5 mode, but allow the table to be modified if the DOCTYPE given is found to NOT be HTML5, through a service TY_(AdjustTags). Care is taken to clear any previous hash cached tags. At present this only effects the anchor tag, but could be applied to others that need to change their parsing due to an identified DOCTYPE.
@geoffmcl With that fix I get this output: <body>
<a id="Section" href="#Section" name="Section">
<h1>Section</h1></a>
</body> It seems to now add a name attribute, which isn't supported in html5. |
@jacksonp some further fixes on doctype and version... hope for some good news... |
@geoffmcl That's great, the tags are now perfect. The indentation seems a bit off tho, here's the output I get with <body>
<a id="Section" href="#Section">
<h1>Section</h1></a>
</body> I think the anchor block should all be one line in this case (same as the input)? |
@jacksonp just glad the tags are right! To me there is a LOT wrong with the pprint.c module, especially when to, and to not add a new line... there is even a feature request to try and keep the current indents, lines, etc... very difficult... But for now I am only concentrating on html tag bugs... Would appreciate you opening a new issue for the pprint output which I think will be attacked after we have 5.0.0 out the door... probably a 5.1 target, unless you, or others, can offer easy PR or diffs... dig into it... Thanks for the quick testing and report... |
Input:
Output of tidy5 -indent:
Note the two anchor tags with id "Section" in the output.
The text was updated successfully, but these errors were encountered: