Skip to content

Commit ee3c7d1

Browse files
committed
links: add refs in metadata
Fixes: nodejs#117
1 parent 491e2b2 commit ee3c7d1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/links.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class LinkParser {
4545
// Do this so we can reliably get the correct url.
4646
// Otherwise, the number could reference a PR or an issue.
4747
getRefUrlFromOP(ref) {
48-
const as = this.OP.querySelectorAll('a.issue-link');
48+
const as = Array.from(this.OP.children)
49+
.filter(c => c.textContent.includes('Refs'))
50+
.map(a => a.querySelector('a'));
4951
const links = Array.from(as);
5052
for (const link of links) {
51-
const text = link.textContent;
52-
if (text === ref) {
53+
if (link.textContent === ref) {
5354
const href = link.getAttribute('href');
5455
if (href) return href;
5556
}

0 commit comments

Comments
 (0)