diff --git a/doc/api/readline.md b/doc/api/readline.md index 32fad5732c70df..23669a8f65c88a 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 442381b54d7b72..ba1f751b022a26 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -48,13 +48,15 @@ const testData = [ '

Foobar II#

' + '
Added in: v5.3.0, v4.2.0
' + - '

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 ae7b2007b7d2ef..c38cfc149ac788 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -103,7 +103,7 @@ const testData = [ added: ['v5.3.0', 'v4.2.0'] }, desc: '

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

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

\n', type: 'module', displayName: 'Foobar II' }, @@ -115,7 +115,7 @@ const testData = [ deprecated: ['v2.0.0'] }, 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 493c2e7e4268b2..4f4aa63f458cc4 100644 --- a/test/fixtures/doc_with_yaml.md +++ b/test/fixtures/doc_with_yaml.md @@ -14,7 +14,7 @@ added: - v4.2.0 --> -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 3dd6f83da503df..1dbdc425616d27 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -288,17 +288,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) {