tools: replace space with \b in regex

PR-URL: https://github.com/nodejs/node/pull/17479
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Diego Rodríguez Baquero 2017-12-06 00:10:14 -05:00 committed by Anatoli Papirovski
parent 1449c18bd8
commit ea77b33a52
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0

View File

@ -416,7 +416,7 @@ const BSD_ONLY_SYSCALLS = new Set(['lchmod']);
// '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'
function linkManPages(text) {
return text.replace(
/ ([a-z.]+)\((\d)([a-z]?)\)/gm,
/\b([a-z.]+)\((\d)([a-z]?)\)/gm,
(match, name, number, optionalCharacter) => {
// name consists of lowercase letters, number is a single digit
const displayAs = `${name}(${number}${optionalCharacter})`;