Skip to content

fix(core/link-to-dfn): treat a data-cite of just the shortName as self citing - #5492

Open
rawsun007 wants to merge 1 commit into
speced:mainfrom
rawsun007:fix-bare-self-cite
Open

rawsun007 wants to merge 1 commit into
speced:mainfrom
rawsun007:fix-bare-self-cite

Conversation

@rawsun007

Copy link
Copy Markdown

Refs #5317

When a citation names the spec itself with nothing after the shortName, such as [[[gamepad]]] or data-cite="!gamepad" in a spec whose shortName is gamepad, updateReferences in core/link-to-dfn did not rewrite it to the self-citation key, because the regex required one more character after the shortName (\b([^-])). The citation was then resolved as an external spec and added to the informative references. Allowing end of string there (([^-]|$)) fixes it, and gamepad-2 style names still do not match.

The issue has no repro, so this is the one context I found where it happens; Refs rather than Closes because there may be others. The new test in data-cite-spec.js fails with the fix reverted (Expected 'https://www.w3.org/TR/gamepad/' to be 'about:srcdoc', and [gamepad] listed under informative references) and passes with it. I ran the data-cite and link-to-dfn suites locally; the xref and inlines suites had network timeouts against respec.org here, the same number with and without the change.

Written by Claude Code (Claude Opus 5.5) under my account, including the fix and the test. The issue was filed by a maintainer; this was not found by an audit.

Proof: npx karma start tests/spec/karma.conf.cjs --single-run --browsers ChromeHeadless --grep="Core — data-cite attribute" after pnpm build:w3c fails in reverted-fix mode with Expected 'https://www.w3.org/TR/gamepad/' to be 'about:srcdoc' and passes on 312168fb.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant