From d2699cfe563ed2169605b8e79b1902d0d3d67f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez=20Baquero?= Date: Sun, 17 Dec 2017 21:46:37 -0500 Subject: [PATCH] tools: fix man pages linking regex The change to word boundary was breaking many doc pages. This reverts the word boundary back to space. PR-URL: https://github.com/nodejs/node/pull/17724 Fixes: https://github.com/nodejs/node/issues/17694 Refs: https://github.com/nodejs/node/pull/17479 Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- tools/doc/html.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/doc/html.js b/tools/doc/html.js index f2d3fcdbba6860..f2e7ed396b7cc4 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -416,15 +416,15 @@ const BSD_ONLY_SYSCALLS = new Set(['lchmod']); // 'open(2)' function linkManPages(text) { return text.replace( - /\b([a-z.]+)\((\d)([a-z]?)\)/gm, - (match, name, number, optionalCharacter) => { + /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm, + (match, beginning, name, number, optionalCharacter) => { // name consists of lowercase letters, number is a single digit const displayAs = `${name}(${number}${optionalCharacter})`; if (BSD_ONLY_SYSCALLS.has(name)) { - return ` ${displayAs}`; } else { - return ` ${displayAs}`; } });