Skip to content

Commit e701510

Browse files
committedNov 29, 2017
links: removed unused class, allows parsing non github refs (#124)
* links: removed unused class, allows parsing non github refs Fixes: nodejs/node-core-utils#117 * test: added test for new refs parsing
1 parent 9609506 commit e701510

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
 

‎lib/links.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ 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 = this.OP.querySelectorAll('a');
4949
const links = Array.from(as);
5050
for (const link of links) {
5151
const text = link.textContent;

‎test/fixtures/op_html.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
"<p>The npm install rules had a hidden dependency on the <code>node</code> binary<br>\ninstall rule creating the <code>$PREFIX/bin</code> directory.</p>\n<p>Because with <code>./configure --shared</code> no binary is created, the rule<br>\nsubsequently failed. Fix that by creating the directory before<br>\ncreating the symlinks to the npm and npx scripts.</p>\n<p>(Whether it makes sense to install npm without a <code>node</code> binary is<br>\na separate question. This commit is not taking positions. :-))</p>\n<p>Regression introduced in commit <a href=\"https://github.com/nodejs/node/commit/ed8c89a07d159b72a2e351a76c92b8b6a15515bd\" class=\"commit-link\"><tt>ed8c89a</tt></a> (\"build: fix shared installing<br>\ntarget\") which, as the commit log indicates, was itself a bug fix for<br>\nthe <code>./configure --shared</code> install.</p>\n<p>Fixes: <a href=\"https://github.com/nodejs/node/issues/16437\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"267969588\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16437\">#16437</a><br>\nRefs: <a href=\"https://github.com/nodejs/node/pull/15148\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"254809069\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/15148\">#15148</a></p>",
33
"<p>Refs: <a href=\"https://github.com/nodejs/node/pull/16293\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"266519190\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16293\">#16293</a></p>\n<h5>Checklist</h5>\n\n<ul class=\"contains-task-list\">\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> <code>make -j4 test</code> (UNIX), or <code>vcbuild test</code> (Windows) passes</li>\n<li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> commit message follows <a href=\"https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines\">commit guidelines</a></li>\n</ul>\n<h5>Affected core subsystem(s)</h5>\n\n<p>vm</p>",
4-
"<p>Included reference to \\'constant time\\' in crypto.timingSafeEqual description</p>\n<p><span aria-label=\"This pull request closes issue #16504.\" class=\"issue-keyword tooltipped tooltipped-se\">Fixes</span> : <a href=\"https://github.com/nodejs/node/issues/16504\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"268571876\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16504\">#16504</a></p>"
4+
"<p>Included reference to \\'constant time\\' in crypto.timingSafeEqual description</p>\n<p><span aria-label=\"This pull request closes issue #16504.\" class=\"issue-keyword tooltipped tooltipped-se\">Fixes</span> : <a href=\"https://github.com/nodejs/node/issues/16504\" class=\"issue-link js-issue-link\" data-error-text=\"Failed to load issue title\" data-id=\"268571876\" data-permission-text=\"Issue title is private\" data-url=\"https://github.com/nodejs/node/issues/16504\">#16504</a></p>",
5+
"<h5>Checklist</h5><ul class=\"contains-task-list\"><li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> <code>make -j4 test</code> (UNIX), or <code>vcbuild test</code> (Windows) passes</li><li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> documentation is changed or added</li><li class=\"task-list-item\"><input checked=\"\" class=\"task-list-item-checkbox\" disabled=\"\" id=\"\" type=\"checkbox\"> commit message follows <a href=\"https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines\">commit guidelines</a></li></ul><h5>Affected core subsystem(s)</h5><p>doc, dgram</p><p>Refs: <a href=\"https://en.wikipedia.org/w/index.php?title=IPv6_address&amp;type=revision&amp;diff=809494791&amp;oldid=804196124\" rel=\"nofollow\">https://en.wikipedia.org/w/index.php?title=IPv6_address&amp;type=revision&amp;diff=809494791&amp;oldid=804196124</a></p>"
56
]

‎test/unit/links.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const expected = [{
1414
}, {
1515
fixes: ['https://github.com/nodejs/node/issues/16504'],
1616
refs: []
17+
}, {
18+
fixes: [],
19+
refs: ['https://en.wikipedia.org/w/index.php?title=IPv6_address&type=revision&diff=809494791&oldid=804196124']
1720
}];
1821

1922
describe('LinkParser', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.