diff --git a/tools/doc/json.mjs b/tools/doc/json.mjs index 1d2eab2e3cf..b9cbc5b2b5c 100644 --- a/tools/doc/json.mjs +++ b/tools/doc/json.mjs @@ -104,10 +104,10 @@ export function jsonAPI({ filename }) { nodes.slice(0, i).every((node) => node.type === 'list') ) { const text = textJoin(node.children[0].children, file); - const stability = text.match(stabilityExpr); + const stability = stabilityExpr.exec(text); if (stability) { current.stability = parseInt(stability[1], 10); - current.stabilityText = stability[2].trim(); + current.stabilityText = stability[2].replaceAll('\n', ' ').trim(); delete nodes[i]; } } diff --git a/tools/doc/stability.mjs b/tools/doc/stability.mjs index 479269df439..aa1ccc827fa 100644 --- a/tools/doc/stability.mjs +++ b/tools/doc/stability.mjs @@ -30,12 +30,17 @@ function collectStability(data) { if (mod.displayName && mod.stability >= 0) { const link = mod.source.replace('doc/api/', '').replace('.md', '.html'); + let { stabilityText } = mod; + if (stabilityText.includes('. ')) { + stabilityText = stabilityText.slice(0, stabilityText.indexOf('.')); + } + stability.push({ api: mod.name, displayName: mod.textRaw, link: link, stability: mod.stability, - stabilityText: `(${mod.stability}) ${mod.stabilityText}`, + stabilityText: `(${mod.stability}) ${stabilityText}`, }); } }