Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e275859

Browse filesBrowse files
aduh95RafaelGSS
authored andcommitted
tools: fix stability index generation
PR-URL: #45346 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
1 parent 326d19a commit e275859
Copy full SHA for e275859

File tree

Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Collapse file

‎tools/doc/json.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/json.mjs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ export function jsonAPI({ filename }) {
104104
nodes.slice(0, i).every((node) => node.type === 'list')
105105
) {
106106
const text = textJoin(node.children[0].children, file);
107-
const stability = text.match(stabilityExpr);
107+
const stability = stabilityExpr.exec(text);
108108
if (stability) {
109109
current.stability = parseInt(stability[1], 10);
110-
current.stabilityText = stability[2].trim();
110+
current.stabilityText = stability[2].replaceAll('\n', ' ').trim();
111111
delete nodes[i];
112112
}
113113
}
Collapse file

‎tools/doc/stability.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/stability.mjs
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@ function collectStability(data) {
3030
if (mod.displayName && mod.stability >= 0) {
3131
const link = mod.source.replace('doc/api/', '').replace('.md', '.html');
3232

33+
let { stabilityText } = mod;
34+
if (stabilityText.includes('. ')) {
35+
stabilityText = stabilityText.slice(0, stabilityText.indexOf('.'));
36+
}
37+
3338
stability.push({
3439
api: mod.name,
3540
displayName: mod.textRaw,
3641
link: link,
3742
stability: mod.stability,
38-
stabilityText: `(${mod.stability}) ${mod.stabilityText}`,
43+
stabilityText: `(${mod.stability}) ${stabilityText}`,
3944
});
4045
}
4146
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.