Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
fix(core/dfn-index): ignore spec titles from external index (speced#4440
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sidvishnoi authored Apr 27, 2023
1 parent 20e478b commit 43f68dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/dfn-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ function collectExternalTerms() {
if (!elem.dataset.cite) {
continue;
}
const { cite, xrefType, linkType } = elem.dataset;
if (!(xrefType || linkType || cite.includes("#"))) {
// Not a reference to a definition
continue;
}
const uniqueID = elem.href;
if (uniqueReferences.has(uniqueID)) {
continue;
Expand Down
3 changes: 3 additions & 0 deletions tests/spec/core/dfn-index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ describe("Core — dfn-index", () => {
<li><a data-cite="ECMASCRIPT#sec-json.parse">parsing</a></li>
<li><a data-cite="ECMASCRIPT#sec-15.12.2">parsing</a></li>
</ul>
<ul class="test" data-testid="ignore-spec-refs">
<li>[[[RDF11-CONCEPTS]]]</li>
</ul>
</section>
<section id="index"></section>`;

Expand Down

0 comments on commit 43f68dd

Please sign in to comment.