Skip to content

feat(core/dfn-index): data-noindex for external terms#5250

Draft
marcoscaceres wants to merge 2 commits intomainfrom
feat/4895-data-noindex
Draft

feat(core/dfn-index): data-noindex for external terms#5250
marcoscaceres wants to merge 2 commits intomainfrom
feat/4895-data-noindex

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

Closes #4895

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a granular opt-out (data-noindex) so authors can prevent specific external data-cite links from being listed under “Terms defined by reference” in the dfn index (per #4895).

Changes:

  • Skip a[data-cite][data-noindex] entries when collecting the external terms index.
  • Strip data-noindex during export cleanup (similar to other ReSpec-only attributes).
  • Add a spec test for the new exclusion behavior and add French l10n strings for the dfn index headings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/core/dfn-index.js Implements data-noindex exclusion in external term collection; adds export cleanup; adds fr l10n strings.
tests/spec/core/dfn-index-spec.js Adds coverage ensuring data-noindex terms are omitted from the external index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +515 to +518
const externalIndex = doc.getElementById("index-defined-elsewhere");
const terms = [...externalIndex.querySelectorAll(".index-term")].map(el =>
el.textContent.trim()
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 904170d. The test now asserts three things:

  1. externalIndex exists (is truthy)
  2. At least one term is present (terms.length > 0)
  3. The expected "Event interface" term is in the list

This prevents a vacuous pass from an empty or missing index section.

Address Copilot feedback: the test now asserts that the external index
section exists and contains the expected 'Event interface' term, so the
absence assertion for the excluded term cannot vacuously pass when
the index is empty.
@marcoscaceres
Copy link
Copy Markdown
Contributor Author

@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed?

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.

Provide an opt-out of the "Terms defined by reference" section

2 participants