GeezerVison is showing github.com — tools: fix stability index generation · nodejs/node@5105060
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: tools/doc/json.mjs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -104,10 +104,10 @@ export function jsonAPI({ filename }) { |
104 | 104 | nodes.slice(0, i).every((node) => node.type === 'list') |
105 | 105 | ) { |
106 | 106 | const text = textJoin(node.children[0].children, file); |
107 | | - const stability = text.match(stabilityExpr); |
| 107 | + const stability = stabilityExpr.exec(text); |
108 | 108 | if (stability) { |
109 | 109 | current.stability = parseInt(stability[1], 10); |
110 | | - current.stabilityText = stability[2].trim(); |
| 110 | + current.stabilityText = stability[2].replaceAll('\n', ' ').trim(); |
111 | 111 | delete nodes[i]; |
112 | 112 | } |
113 | 113 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: tools/doc/stability.mjs +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,12 +30,17 @@ function collectStability(data) { |
30 | 30 | if (mod.displayName && mod.stability >= 0) { |
31 | 31 | const link = mod.source.replace('doc/api/', '').replace('.md', '.html'); |
32 | 32 |
|
| 33 | + let { stabilityText } = mod; |
| 34 | + if (stabilityText.includes('. ')) { |
| 35 | + stabilityText = stabilityText.slice(0, stabilityText.indexOf('.')); |
| 36 | + } |
| 37 | + |
33 | 38 | stability.push({ |
34 | 39 | api: mod.name, |
35 | 40 | displayName: mod.textRaw, |
36 | 41 | link: link, |
37 | 42 | stability: mod.stability, |
38 | | - stabilityText: `(${mod.stability}) ${mod.stabilityText}`, |
| 43 | + stabilityText: `(${mod.stability}) ${stabilityText}`, |
39 | 44 | }); |
40 | 45 | } |
41 | 46 | } |
|