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:
parent
1449c18bd8
commit
ea77b33a52
@ -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})`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user