From a21d4f75af712e03cf2a67fea46862a2fb041a00 Mon Sep 17 00:00:00 2001 From: Fabien MICHEL Date: Sat, 3 Dec 2022 19:53:55 +0100 Subject: [PATCH] tools: fix incorrect version history order This fixes an error in parseYAML(text), the version sorting coudn't be right as we compared an arrify string (ie. a = ["v18.11, v16.7.0"]) with an array of strings (ie. b = ["v18.07", "v16.7.0"]) in versionSort(a, b). minVersion(a) couldn't find the minimum version with an arrify string like a = ["v18.11, v16.7.0"]. That's why incorrect version history orders sometimes appeared. Fixes: https://github.com/nodejs/node/issues/45670 --- tools/doc/html.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/doc/html.mjs b/tools/doc/html.mjs index 373f5487a31d4b..f436055ba77012 100644 --- a/tools/doc/html.mjs +++ b/tools/doc/html.mjs @@ -325,18 +325,18 @@ function parseYAML(text) { const removed = { description: '' }; if (meta.added) { - added.version = meta.added.join(', '); + added.version = meta.added; added.description = `Added in: ${added.version}`; } if (meta.deprecated) { - deprecated.version = meta.deprecated.join(', '); + deprecated.version = meta.deprecated; deprecated.description = `Deprecated since: ${deprecated.version}`; } if (meta.removed) { - removed.version = meta.removed.join(', '); + removed.version = meta.removed; removed.description = `Removed in: ${removed.version}`; }