Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/browserlib/extract-dfns.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ export default function (spec, idToHeading = {}) {
// (pending a proper dfns curation process, see:
// https://github.com/w3c/webref/issues/789)
.filter(node => {
const link = node.querySelector('a[href^="http"]');
const link =
node.querySelector('a[href^="http"]') ??
node.closest('a[href^="http"]');
return !link ||
(node.textContent.trim() !== link.textContent.trim()) ||
(link.href === 'https://www.w3.org/TR/CSS2/syndata.html#vendor-keywords');
Expand Down
6 changes: 6 additions & 0 deletions tests/extract-dfns.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ const tests = [
changesToBaseDfn: [],
spec: "html"
},
{
title: "ignores definitions imported in the Source map format spec",
html: '<li>The <a href="https://infra.spec.whatwg.org/#byte-sequence"><dfn id="external-whatwg-infra-byte-sequence">byte sequence</dfn></a>',
changesToBaseDfn: [],
spec: "sourcemap"
},
{
"title": "extracts attribute definition from the SVG2 spec",
html: `<table class="attrdef def"><tr>
Expand Down