Skip to content

Duplicate IDs are not detected if the ID has an uppercase letter #726

Closed
@petdance

Description

@petdance
$ cat -n foo.html
     1  <!DOCTYPE html>
     2  <html>
     3      <head>
     4          <title>Tidy does not detect dupe IDs if they have uppercase letters</title>
     5      </head>
     6      <body>
     7          <p    id="foo">1</p>
     8          <div  id="foo">2</div>
     9          <span id="foo">3</span>
    10
    11          <p    id="foo99">1</p>
    12          <div  id="foo99">2</div>
    13          <span id="foo99">3</span>
    14
    15          <p    id="Foo">1</p>
    16          <div  id="Foo">2</div>
    17          <span id="Foo">3</span>
    18
    19          <p    id="FOO">1</p>
    20          <div  id="FOO">2</div>
    21          <span id="FOO">3</span>
    22
    23          <a name="foo">1</a>
    24          <a name="foo">2</a>
    25          <a name="foo">3</a>
    26
    27          <a name="FOO">1</a>
    28          <a name="FOO">2</a>
    29          <a name="FOO">3</a>
    30      </body>
    31  </html>
$ tidy -q -e foo.html
line 8 column 9 - Warning: <div> anchor "foo" already defined
line 9 column 9 - Warning: <span> anchor "foo" already defined
line 12 column 9 - Warning: <div> anchor "foo99" already defined
line 13 column 9 - Warning: <span> anchor "foo99" already defined
line 23 column 9 - Warning: <a> anchor "foo" already defined
line 24 column 9 - Warning: <a> anchor "foo" already defined
line 25 column 9 - Warning: <a> anchor "foo" already defined

If the id or name values have an uppercase letter, then Tidy will not dupe-check them. It will do the correct thing with digits.

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