w3c / aria-common

Shared files for the ARIA repositories
Other
8 stars 15 forks source link

Prevent resolveReferences.js from pruning internal references we use #23

Closed joanmarie closed 5 years ago

joanmarie commented 5 years ago

The script logic was returning early for all internal references which were not also directly referenced by the main content (for instance "class" and "text node" from Core AAM).

The script already keeps track of unused (by the main content) items in the termNames array. Therefore, we can check that array to see if it contains the parent glossary term. If so, then return early like before. Otherwise, let the script proceed.

Addresses github issue #20.

jnurthen commented 5 years ago

Yeah, there's no recursion. So I believe you're correct. Bah. (And good catch.) I'll do a new version tomorrow that handles that scenario.

Thanks for the review!

Can we merge this as is - despite the fact it may still prune too many it would certainly be an improvement over the current state (aria spec has 2 invalid links in the references for example)