mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
doc: fix stability 1.x links excluding the decimal digit
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
5f3262add6
commit
d8de8f3d6b
1 changed files with 3 additions and 2 deletions
|
@ -206,10 +206,11 @@ function linkJsTypeDocs(text) {
|
|||
|
||||
const isJSFlavorSnippet = (node) => node.lang === 'cjs' || node.lang === 'mjs';
|
||||
|
||||
const STABILITY_RE = /(.*:)\s*(\d(?:\.\d)?)([\s\S]*)/;
|
||||
|
||||
// Preprocess headers, stability blockquotes, and YAML blocks.
|
||||
export function preprocessElements({ filename }) {
|
||||
return (tree) => {
|
||||
const STABILITY_RE = /(.*:)\s*(\d)([\s\S]*)/;
|
||||
let headingIndex = -1;
|
||||
let heading = null;
|
||||
|
||||
|
@ -325,7 +326,7 @@ export function preprocessElements({ filename }) {
|
|||
// Insert div with prefix and number
|
||||
node.children.unshift({
|
||||
type: 'html',
|
||||
value: `<div class="api_stability api_stability_${number}">` +
|
||||
value: `<div class="api_stability api_stability_${parseInt(number)}">` +
|
||||
(noLinking ? '' :
|
||||
'<a href="documentation.html#stability-index">') +
|
||||
`${prefix} ${number}${noLinking ? '' : '</a>'}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue