Skip to content

Commit

Permalink
Ignore definitions in <del> markup (#1688)
Browse files Browse the repository at this point in the history
close #1687
  • Loading branch information
dontcallmedom authored Oct 11, 2024
1 parent 5b92955 commit edb269f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/browserlib/extract-dfns.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ export default function (spec, idToHeading = {}) {
})
.filter(hasValidType)
// Exclude IDL terms defined in a block that is flagged as to be excluded
.filter(node => !node.closest('.exclude'))
// or inside a <del>
.filter(node => !node.closest('.exclude,del'))
// When the whole term links to an external spec, the definition is an
// imported definition. Such definitions are not "real" definitions, let's
// skip them.
Expand Down
4 changes: 4 additions & 0 deletions tests/extract-dfns.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ const tests = [
html: "<dfn id=foo data-dfn-type=invalidtype>Foo</dfn>",
changesToBaseDfn: []
},
{title: "ignores dfns in a <del>",
html: "<del><dfn id=foo>Foo</dfn></del>",
changesToBaseDfn: []
},
{title: "ignores dfns already exported",
html: "<dfn id='foo' data-dfn-type='dfn' data-export>Foo</dfn>. <dfn id='foo2' data-export>Foo</dfn> is already exported.",
changesToBaseDfn: [{ access: "public" }]
Expand Down

0 comments on commit edb269f

Please sign in to comment.