feat(core/dfn-index): data-noindex for external terms#5250
Draft
marcoscaceres wants to merge 2 commits intomainfrom
Draft
feat(core/dfn-index): data-noindex for external terms#5250marcoscaceres wants to merge 2 commits intomainfrom
marcoscaceres wants to merge 2 commits intomainfrom
Conversation
…erms index Closes #4895
Contributor
There was a problem hiding this comment.
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-noindexduring 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() | ||
| ); |
Contributor
Author
There was a problem hiding this comment.
Fixed in 904170d. The test now asserts three things:
externalIndexexists (is truthy)- At least one term is present (
terms.length > 0) - 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.
Contributor
Author
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4895