Skip to content

Commit

Permalink
doc: remove problematic auto-linking of curl man pages
Browse files Browse the repository at this point in the history
The only instance of curl man page linking is in repl.md and it is
explicit. The magic autolinking in html.js creates a superfluous empty
link. Remove it.

Before, two adjacent links generated, with the first one having no text:

```html
<a href="https://curl.haxx.se/docs/manpage.html"></a>
<a href="https://curl.haxx.se/docs/manpage.html"><code>curl(1)</code></a>
```

After, just one link:

```html
<a href="https://curl.haxx.se/docs/manpage.html"><code>curl(1)</code></a>
```

PR-URL: #35174
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott committed Sep 15, 2020
1 parent 2b3eb10 commit 26e660f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ For an example of running a "full-featured" (`terminal`) REPL over
a `net.Server` and `net.Socket` instance, see:
<https://gist.github.com/TooTallNate/2209310>.

For an example of running a REPL instance over [curl(1)][], see:
For an example of running a REPL instance over [`curl(1)`][], see:
<https://gist.github.com/TooTallNate/2053342>.

[ZSH]: https://en.wikipedia.org/wiki/Z_shell
Expand All @@ -761,5 +761,5 @@ For an example of running a REPL instance over [curl(1)][], see:
[`util.inspect()`]: util.html#util_util_inspect_object_options
[`reverse-i-search`]: #repl_reverse_i_search
[TTY keybindings]: readline.html#readline_tty_keybindings
[curl(1)]: https://curl.haxx.se/docs/manpage.html
[`curl(1)`]: https://curl.haxx.se/docs/manpage.html
[stream]: stream.html
4 changes: 0 additions & 4 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ function preprocessText({ nodeVersion }) {

// Syscalls which appear in the docs, but which only exist in BSD / macOS.
const BSD_ONLY_SYSCALLS = new Set(['lchmod']);
const HAXX_ONLY_SYSCALLS = new Set(['curl']);
const MAN_PAGE = /(^|\s)([a-z.]+)\((\d)([a-z]?)\)/gm;

// Handle references to man pages, eg "open(2)" or "lchmod(2)".
Expand All @@ -143,9 +142,6 @@ function linkManPages(text) {
return `${beginning}<a href="https://www.freebsd.org/cgi/man.cgi` +
`?query=${name}&sektion=${number}">${displayAs}</a>`;
}
if (HAXX_ONLY_SYSCALLS.has(name)) {
return `${beginning}<a href="https://${name}.haxx.se/docs/manpage.html">${displayAs}</a>`;
}

return `${beginning}<a href="http://man7.org/linux/man-pages/man${number}` +
`/${name}.${number}${optionalCharacter}.html">${displayAs}</a>`;
Expand Down

0 comments on commit 26e660f

Please sign in to comment.