Skip to content
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

Unexpected parsing a tag in table #919

Closed
PeterHo249 opened this issue Jan 15, 2021 · 2 comments
Closed

Unexpected parsing a tag in table #919

PeterHo249 opened this issue Jan 15, 2021 · 2 comments

Comments

@PeterHo249
Copy link

Hi there,
I run the latest tidy release command tidy.exe -o <output_path> <input_path> with the attached sample. The start button in the output file becomes unclickable. Is it expected behavior? Is there any option to keep the interactive of the button?
The output message when run command:

line 104 column 37 - Warning: missing </span> before </center>
line 114 column 1 - Warning: missing </a> before <table>
line 119 column 1 - Warning: missing </a> before <center>
line 121 column 1 - Warning: discarding unexpected </a>
line 125 column 1 - Warning: discarding unexpected </a>
line 41 column 185 - Warning: <img> lacks "alt" attribute
line 94 column 38 - Warning: <img> lacks "alt" attribute
line 241 column 16 - Warning: <img> lacks "alt" attribute
line 245 column 1 - Warning: <br> attribute "clear" has invalid value "both"
line 12 column 1 - Warning: <td> attribute "align" not allowed for HTML5
line 13 column 1 - Warning: <table> attribute "align" not allowed for HTML5
line 16 column 1 - Warning: <td> attribute "align" not allowed for HTML5
line 17 column 1 - Warning: <table> attribute "align" not allowed for HTML5
line 32 column 1 - Warning: <table> attribute "align" not allowed for HTML5
line 65 column 1 - Warning: <table> attribute "align" not allowed for HTML5
line 94 column 1 - Warning: <center> element removed from HTML5
line 99 column 1 - Warning: <center> element removed from HTML5
line 104 column 1 - Warning: <center> element removed from HTML5
line 109 column 1 - Warning: <center> element removed from HTML5
line 120 column 1 - Warning: <center> element removed from HTML5
line 120 column 9 - Warning: <font> element removed from HTML5
line 134 column 1 - Warning: <center> element removed from HTML5
line 222 column 1 - Warning: <table> attribute "align" not allowed for HTML5
line 6 column 1 - Warning: <style> proprietary attribute "nonce"
Info: Document content looks like HTML5
Tidy found 25 warnings and 0 errors!

sample.zip

Thanks.

@ler762
Copy link
Contributor

ler762 commented Jan 21, 2021

Is there any option to keep the interactive of the button?

Pay attention to the warnings. They say you need to fix the html:

$ cat x.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><title>stc</title> <body>
<a href="https://clicktime.symantec.com/3KY">
<center>start</center>
</a>
</body> </html>

$ tidy --tidy-mark no -q x.html
line 3 column 1 - Warning: missing </a> before <center>
line 5 column 1 - Warning: discarding unexpected </a>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>stc</title>
</head>
<body>
<a href="https://clicktime.symantec.com/3KY"></a>
<center>start</center>
</body>
</html>

@geoffmcl
Copy link
Contributor

@PeterHo249, seems @ler762 has pointed you to possibly why this has happened...

You must first FIX the html...

In this case the use of <center> element inside an inline element <a href="...">...</a>...

While browsers generally do not care, and may show a link, even with very BAD html coding...

Tidy on the other hand attempts to first fix the html, and in doing so may break the link...

Closing this until a real issue for tidy is explained, detailed... thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants