Skip to content

Commit 2384bfd

Browse files
dario-piotrowiczaduh95
authored andcommitted
doc: fix stability 1.x links excluding the decimal digit
PR-URL: #58783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8c61b96 commit 2384bfd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tools/doc/html.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ function linkJsTypeDocs(text) {
206206

207207
constisJSFlavorSnippet=(node)=>node.lang==='cjs'||node.lang==='mjs';
208208

209+
constSTABILITY_RE=/(.*:)\s*(\d(?:\.\d)?)([\s\S]*)/;
210+
209211
// Preprocess headers, stability blockquotes, and YAML blocks.
210212
exportfunctionpreprocessElements({ filename }){
211213
return(tree)=>{
212-
constSTABILITY_RE=/(.*:)\s*(\d)([\s\S]*)/;
213214
letheadingIndex=-1;
214215
letheading=null;
215216

@@ -325,7 +326,7 @@ export function preprocessElements({ filename }) {
325326
// Insert div with prefix and number
326327
node.children.unshift({
327328
type: 'html',
328-
value: `<div class="api_stability api_stability_${number}">`+
329+
value: `<div class="api_stability api_stability_${parseInt(number)}">`+
329330
(noLinking ? '' :
330331
'<a href="documentation.html#stability-index">')+
331332
`${prefix}${number}${noLinking ? '' : '</a>'}`

0 commit comments

Comments
 (0)