Skip to content

Commit c0429d1

Browse files
committed
docs: Change broken fg(1) links to fg(1p)
The fg(1) links in the readline docs have moved from `http://man7.org/linux/man-pages/man1/fg.1.html` to `http://man7.org/linux/man-pages/man1/fg.1p.html`. It also modifies the regex for replacing man page links in docs by allowing optional character after number. eg: fg(1) and fg(1p) will both be now parsed and replaced. Fixes: #11492
1 parent 5f08871 commit c0429d1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/api/readline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ added: v0.7.5
124124

125125
The `'SIGCONT'` event is emitted when a Node.js process previously moved into
126126
the background using `<ctrl>-Z` (i.e. `SIGTSTP`) is then brought back to the
127-
foreground using fg(1).
127+
foreground using fg(1p).
128128

129129
If the `input` stream was paused *before* the `SIGTSTP` request, this event will
130130
not be emitted.
@@ -174,7 +174,7 @@ input, typically known as `SIGTSTP`. If there are no `SIGTSTP` event listeners
174174
registered when the `input` stream receives a `SIGTSTP`, the Node.js process
175175
will be sent to the background.
176176

177-
When the program is resumed using fg(1), the `'pause'` and `SIGCONT` events
177+
When the program is resumed using fg(1p), the `'pause'` and `SIGCONT` events
178178
will be emitted. These can be used to resume the `input` stream.
179179

180180
The `'pause'` and `'SIGCONT'` events will not be emitted if the `input` was

tools/doc/html.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,15 @@ var BSD_ONLY_SYSCALLS = new Set(['lchmod']);
288288
// Returns modified text, with such refs replace with HTML links, for example
289289
// '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>'
290290
function linkManPages(text) {
291-
return text.replace(/ ([a-z.]+)\((\d)\)/gm, function(match, name, number) {
291+
return text.replace(/ ([a-z.]+)\((\d)([a-z]?)\)/gm, function(match, name, number, optionalCharacter) {
292292
// name consists of lowercase letters, number is a single digit
293-
var displayAs = name + '(' + number + ')';
293+
var displayAs = name + '(' + number + optionalCharacter + ')';
294294
if (BSD_ONLY_SYSCALLS.has(name)) {
295295
return ' <a href="https://www.freebsd.org/cgi/man.cgi?query=' + name +
296296
'&sektion=' + number + '">' + displayAs + '</a>';
297297
} else {
298298
return ' <a href="http://man7.org/linux/man-pages/man' + number +
299-
'/' + name + '.' + number + '.html">' + displayAs + '</a>';
299+
'/' + name + '.' + (number + optionalCharacter) + '.html">' + displayAs + '</a>';
300300
}
301301
});
302302
}

0 commit comments

Comments
 (0)