Skip to content

Commit

Permalink
Adapt reference extractor to modern IETF HTML-formatted RFCs (#676)
Browse files Browse the repository at this point in the history
Some of the references contain link to email addresses, which needs to be ignored to hit the actual useful link
  • Loading branch information
dontcallmedom authored Jul 1, 2021
1 parent 0bd7d82 commit ee87a7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/browserlib/extract-references.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function parseReferences(referenceList, options) {
if (!desc || !ref.name) {
return;
}
ref.url = desc.querySelector("a[href]") ? desc.querySelector("a[href]").href : "";
ref.url = desc.querySelector('a[href^="http"]')?.href ?? "";
if (options.filterInformative &&
desc.textContent.match(/non-normative/i)) {
return informativeRef.push(ref);
Expand Down Expand Up @@ -195,4 +195,4 @@ function extractReferences(rules) {
});

return references;
}
}

0 comments on commit ee87a7f

Please sign in to comment.