Skip to content

Commit

Permalink
docs: Change broken fg(1) links to fg(1p)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
karanjthakkar committed Feb 22, 2017
1 parent 5f08871 commit c0429d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ added: v0.7.5

The `'SIGCONT'` event is emitted when a Node.js process previously moved into
the background using `<ctrl>-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.
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ var BSD_ONLY_SYSCALLS = new Set(['lchmod']);
// 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>'
function linkManPages(text) {
return text.replace(/ ([a-z.]+)\((\d)\)/gm, function(match, name, number) {
return text.replace(/ ([a-z.]+)\((\d)([a-z]?)\)/gm, function(match, name, number, optionalCharacter) {
// name consists of lowercase letters, number is a single digit
var displayAs = name + '(' + number + ')';
var displayAs = name + '(' + number + optionalCharacter + ')';
if (BSD_ONLY_SYSCALLS.has(name)) {
return ' <a href="https://www.freebsd.org/cgi/man.cgi?query=' + name +
'&sektion=' + number + '">' + displayAs + '</a>';
} else {
return ' <a href="http://man7.org/linux/man-pages/man' + number +
'/' + name + '.' + number + '.html">' + displayAs + '</a>';
'/' + name + '.' + (number + optionalCharacter) + '.html">' + displayAs + '</a>';
}
});
}
Expand Down

0 comments on commit c0429d1

Please sign in to comment.