From eecc04cc24207120035baa26cc93b8cb3b2d8279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerson=20Ni=C3=B1o?= Date: Tue, 9 Apr 2019 22:30:03 -0500 Subject: [PATCH] tools,doc: fix 404 broken links in docs Change the linkManPages function to catch the uname and curl correct websites on the docs page. Fixes: https://github.com/nodejs/node/issues/26074 --- tools/doc/html.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/doc/html.js b/tools/doc/html.js index c7ffb392e05ad2..9db4d01f9b070b 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -120,6 +120,8 @@ function preprocessText() { // Syscalls which appear in the docs, but which only exist in BSD / macOS. const BSD_ONLY_SYSCALLS = new Set(['lchmod']); +const LINUX_DIE_ONLY_SYSCALLS = new Set(['uname']); +const HAXX_ONLY_SYSCALLS = new Set(['curl']); const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm; // Handle references to man pages, eg "open(2)" or "lchmod(2)". @@ -135,9 +137,15 @@ function linkManPages(text) { if (BSD_ONLY_SYSCALLS.has(name)) { return `${beginning}${displayAs}`; + } else if (LINUX_DIE_ONLY_SYSCALLS.has(name)) { + return `${beginning}${displayAs}`; + } else if (HAXX_ONLY_SYSCALLS.has(name)) { + return `${beginning}${displayAs}`; + } else { + return `${beginning}${displayAs}`; } - return `${beginning}${displayAs}`; }); }