Skip to content

Commit

Permalink
links: add refs in metadata
Browse files Browse the repository at this point in the history
Fixes: nodejs#117
  • Loading branch information
Tiriel committed Nov 23, 2017
1 parent 491e2b2 commit ee3c7d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ class LinkParser {
// Do this so we can reliably get the correct url.
// Otherwise, the number could reference a PR or an issue.
getRefUrlFromOP(ref) {
const as = this.OP.querySelectorAll('a.issue-link');
const as = Array.from(this.OP.children)
.filter(c => c.textContent.includes('Refs'))
.map(a => a.querySelector('a'));
const links = Array.from(as);
for (const link of links) {
const text = link.textContent;
if (text === ref) {
if (link.textContent === ref) {
const href = link.getAttribute('href');
if (href) return href;
}
Expand Down

0 comments on commit ee3c7d1

Please sign in to comment.