diff --git a/doc/api/readline.md b/doc/api/readline.md index b7c9a506309..b3be83bb6eb 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -124,7 +124,7 @@ added: v0.7.5 The `'SIGCONT'` event is emitted when a Node.js process previously moved into the background using `-Z` (i.e. `SIGTSTP`) is then brought back to the -foreground using fg(1). +foreground using fg(1p). If the `input` stream was paused *before* the `SIGTSTP` request, this event will not be emitted. @@ -174,7 +174,7 @@ input, typically known as `SIGTSTP`. If there are no `SIGTSTP` event listeners registered when the `input` stream receives a `SIGTSTP`, the Node.js process will be sent to the background. -When the program is resumed using fg(1), the `'pause'` and `SIGCONT` events +When the program is resumed using fg(1p), the `'pause'` and `SIGCONT` events will be emitted. These can be used to resume the `input` stream. The `'pause'` and `'SIGCONT'` events will not be emitted if the `input` was diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index a990d35507a..e119ee86172 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -56,13 +56,16 @@ const testData = [ 'v4.2.0

The error parameter can now be' + 'an arrow function.

' + ' ' + - '

Describe Foobar II in more detail here.

' + + '

Describe Foobar II in more detail here.' + + 'fg(1)

' + '

Deprecated thingy#' + '

' + '
Added in: v1.0.0' + 'Deprecated since: v2.0.0

Describe ' + - 'Deprecated thingy in more detail here.

' + + 'Deprecated thingy in more detail here.' + + 'fg(1p)' + + '

' + '

Something#

' + ' ' + diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 1019728f0fe..346a7f331e9 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -111,7 +111,7 @@ const testData = [ ] }, desc: '

Describe Foobar II in more detail ' + - 'here.

\n', + 'here. fg(1)

\n', type: 'module', displayName: 'Foobar II' }, @@ -124,7 +124,7 @@ const testData = [ changes: [] }, desc: '

Describe Deprecated thingy in more ' + - 'detail here.

\n', + 'detail here. fg(1p)

\n', type: 'module', displayName: 'Deprecated thingy' }, diff --git a/test/fixtures/doc_with_yaml.md b/test/fixtures/doc_with_yaml.md index cf039c243a4..89cf28104e5 100644 --- a/test/fixtures/doc_with_yaml.md +++ b/test/fixtures/doc_with_yaml.md @@ -18,7 +18,7 @@ changes: description: The `error` parameter can now be an arrow function. --> -Describe `Foobar II` in more detail here. +Describe `Foobar II` in more detail here. fg(1) ## Deprecated thingy -Describe `Deprecated thingy` in more detail here. +Describe `Deprecated thingy` in more detail here. fg(1p) ## Something diff --git a/tools/doc/html.js b/tools/doc/html.js index bc5d3167f7b..10b04a1b988 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -316,17 +316,19 @@ var BSD_ONLY_SYSCALLS = new Set(['lchmod']); // Returns modified text, with such refs replace with HTML links, for example // 'open(2)' function linkManPages(text) { - return text.replace(/ ([a-z.]+)\((\d)\)/gm, function(match, name, number) { - // name consists of lowercase letters, number is a single digit - var displayAs = name + '(' + number + ')'; - if (BSD_ONLY_SYSCALLS.has(name)) { - return ' ' + displayAs + ''; - } else { - return ' ' + displayAs + ''; - } - }); + return text.replace( + / ([a-z.]+)\((\d)([a-z]?)\)/gm, + (match, name, number, optionalCharacter) => { + // name consists of lowercase letters, number is a single digit + var displayAs = `${name}(${number}${optionalCharacter})`; + if (BSD_ONLY_SYSCALLS.has(name)) { + return ` ${displayAs}`; + } else { + return ` ${displayAs}`; + } + }); } function linkJsTypeDocs(text) {