Skip to content

Commit

Permalink
tools: use better regexp for manpage references
Browse files Browse the repository at this point in the history
In practice, manpage names may contain dots (e.g. `resolv.conf(5)`).

PR-URL: #9632
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
addaleax authored and MylesBorins committed Dec 21, 2016
1 parent c6eaf41 commit ad20889
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ 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)\)/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)) {
Expand Down

0 comments on commit ad20889

Please sign in to comment.