tools: use better regexp for manpage references
In practice, manpage names may contain dots (e.g. `resolv.conf(5)`). PR-URL: https://github.com/nodejs/node/pull/9632 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
dbf4bf2bec
commit
79c382787f
@ -263,7 +263,7 @@ var BSD_ONLY_SYSCALLS = new Set(['lchmod']);
|
|||||||
// Returns modified text, with such refs replace with HTML links, for example
|
// Returns modified text, with such refs replace with HTML links, for example
|
||||||
// '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'
|
// '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'
|
||||||
function linkManPages(text) {
|
function linkManPages(text) {
|
||||||
return text.replace(/ ([a-z]+)\((\d)\)/gm, function(match, name, number) {
|
return text.replace(/ ([a-z.]+)\((\d)\)/gm, function(match, name, number) {
|
||||||
// name consists of lowercase letters, number is a single digit
|
// name consists of lowercase letters, number is a single digit
|
||||||
var displayAs = name + '(' + number + ')';
|
var displayAs = name + '(' + number + ')';
|
||||||
if (BSD_ONLY_SYSCALLS.has(name)) {
|
if (BSD_ONLY_SYSCALLS.has(name)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user