Skip to content

--strict-tags-attributes no doesn't ignore <td align> #729

@petdance

Description

@petdance

This looks like it may be related to #688.

HTML file with an old table in it.

$ cat -n foo.html
     1  <!DOCTYPE html>
     2  <html>
     3      <head>
     4          <title> Alignment </title>
     5      </head>
     6      <body>
     7
     8          <table>
     9              <tr valign="bottom">
    10                  <td width="50" align="center">
    11                      text
    12                  </td>
    13              </tr>
    14          </table>
    15
    16      </body>
    17  </html>

tidy complains with --strict-tags-attributes yes about <tr valign>, <td width> and <td align>, as would expect.

$ tidy -q -e --strict-tags-attributes yes foo.html
line 9 column 13 - Error: <tr> attribute "valign" not allowed for HTML5
line 10 column 17 - Error: <td> attribute "width" not allowed for HTML5
line 10 column 17 - Error: <td> attribute "align" not allowed for HTML5
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.

However, with --strict-tags-attributes no, or with no option, it still complains about <td align> even though it has NOT complained about the <td width>.

$ tidy -q -e --strict-tags-attributes no foo.html
line 10 column 17 - Warning: <td> attribute "align" not allowed for HTML5
$ tidy -q -e foo.html
line 10 column 17 - Warning: <td> attribute "align" not allowed for HTML5

I'm expecting that tidy will not complain about <td align> in the bottom two cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions