Skip to content

--drop-proprietary-attributes yes --strict-tags-attributes yes causes tidy to report error instead of dropping non-applicable HTML attributes #688

@i-give-up

Description

@i-give-up

[Bug] According to the quickref, when both drop-proprietary-attributes and strict-tags-attributes are enabled, tidy should drop attributes that are not applicable to the HTML version. In reality, tidy reports errors instead.

Environment

  • HTML Tidy for Windows version 5.6.0
  • Windows 8.1

Command

tidy --strict-tags-attributes yes --drop-proprietary-attributes yes test.html

I also tried switching the order of the options but the issue persists.

Input

test.html

<!DOCTYPE html>
<html>
  <title>Testing</title>
<body>
<table>
  <tr>
    <td align="left" valign="top">Hello whirl!</td>
  </tr>
</table>
</body>
</html>

Expected Output

Non-applicable attributes align and valign should be removed from <td>

<!DOCTYPE html>
<html>
  <title>Testing</title>
<body>
<table>
  <tr>
    <td>Hello whirl!</td>
  </tr>
</table>
</body>
</html>

Actual Output

line 7 column 5 - Error: <td> attribute "align" not allowed for HTML5
line 7 column 5 - Error: <td> attribute "valign" not allowed for HTML5

Update

Apparently it works as expected if you include the option --force-output yes. This is non-ideal though because I want it to generate output if it's just non-applicable attributes and to fail if it's some other error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions