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

Improper deduping when for values have different casing, and anchor is from anchor block #2837

Open
tabatkins opened this issue Apr 18, 2024 · 4 comments
Labels

Comments

@tabatkins
Copy link
Collaborator

Example document:

<pre class='metadata'>
Title: test
Shortname: test
Status: DREAM
Editor: foo
Abstract: foo
Die On: nothing
</pre>

<pre class="anchors">
spec: dom; urlPrefix: https://dom.spec.whatwg.org/
    type: dfn
        text: origin; for: document; url: concept-document-origin
</pre>

[=Document/origin=].

[=document/origin=].

Giving a "duplicated ID" warning, because it generates two identical entries in the index.

@tabatkins tabatkins added the bug label Apr 18, 2024
@tabatkins
Copy link
Collaborator Author

Ah, this is because DOM actually defines this reference, with for=Document, but the anchor-block defines it with for=document. So the two autolinks resolve to different references (so no deduping), but the two references are identical (so the generated ID ends up being identical).

@jyasskin
Copy link
Collaborator

i.e., this should probably be an error, just a more comprehensible one. :)

@tabatkins
Copy link
Collaborator Author

Indeed, and this is actually nice because I've been wondering how to help authors identify anchor-block refs they can remove. This problem suggests that I can just use similar code to what I have for generating IDs to identify "unnecessary" anchors. Not trivial, but easier than what I was imagining I'd have to do.

@tabatkins
Copy link
Collaborator Author

Closely related issue: if you add an anchor-block entry for a ref that already exists, but use a different spec name for it, you'll end up with two entries in your Index that also have identical generated IDs.

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

No branches or pull requests

2 participants