GeezerVison is showing github.com — tools,doc: fix version picker bug in html.js · nodejs/node@1625329
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/doctool/test-doctool-html.js +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -95,6 +95,10 @@ const testData = [ |
95 | 95 | html: '<ol><li>fish</li><li>fish</li></ol>' + |
96 | 96 | '<ul><li>Red fish</li><li>Blue fish</li></ul>', |
97 | 97 | }, |
| 98 | + { |
| 99 | + file: fixtures.path('altdocs.md'), |
| 100 | + html: '<li><a href="https://nodejs.org/docs/latest-v8.x/api/foo.html">8.x', |
| 101 | + }, |
98 | 102 | ]; |
99 | 103 |
|
100 | 104 | const spaces = /\s/g; |
@@ -117,7 +121,8 @@ testData.forEach(({ file, html }) => { |
117 | 121 | const actual = output.replace(spaces, ''); |
118 | 122 | // Assert that the input stripped of all whitespace contains the |
119 | 123 | // expected markup. |
120 | | - assert(actual.includes(expected)); |
| 124 | + assert(actual.includes(expected), |
| 125 | + `ACTUAL: ${actual}\nEXPECTED: ${expected}`); |
121 | 126 | }) |
122 | 127 | ); |
123 | 128 | })); |
|
Collapse file
Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +# ALTDOCS |
| 2 | +<!--introduced_in=v8.4.0--> |
Collapse file
Copy file name to clipboardExpand all lines: tools/doc/html.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -427,6 +427,7 @@ function altDocs(filename, docCreated) { |
427 | 427 | const [versionMajor, versionMinor] = version.num.split('.').map(Number); |
428 | 428 | if (docCreatedMajor > versionMajor) return false; |
429 | 429 | if (docCreatedMajor < versionMajor) return true; |
| 430 | + if (Number.isNaN(versionMinor)) return true; |
430 | 431 | return docCreatedMinor <= versionMinor; |
431 | 432 | } |
432 | 433 |
|
|