git: 71469bf91c - main - more restrict manual page reference detection
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 05 Feb 2022 16:54:29 UTC
The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/doc/commit/?id=71469bf91c731b378644a77c9823f2c0310ed11b commit 71469bf91c731b378644a77c9823f2c0310ed11b Author: Wolfram Schneider <wosch@FreeBSD.org> AuthorDate: 2022-02-05 16:52:39 +0000 Commit: Wolfram Schneider <wosch@FreeBSD.org> CommitDate: 2022-02-05 16:52:39 +0000 more restrict manual page reference detection No white spaces between man page and brackets, e.g. gpart(8) is valid, but gpart (8) not. PR: 261706 Reported by: Graham Perrin --- website/content/en/cgi/man.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/content/en/cgi/man.cgi b/website/content/en/cgi/man.cgi index 4734042f8c..64a68ed144 100755 --- a/website/content/en/cgi/man.cgi +++ b/website/content/en/cgi/man.cgi @@ -1616,8 +1616,11 @@ qq{Please try a <a href="$BASE?apropos=1&manpath=freebsd-release-ports&q ( $regexp = $match ) =~ s/\./\\\./; s,$regexp,\<a href=\"$BASE/usr/include/$match\"\>$match\</A\>,; } - /^\s/ && # skip headers -s,((<[IB]>)?[\w\_\.\-]+\s*(</[IB]>)?\s*\(([1-9ln][a-zA-Z]*)\)),&mlnk($1),oige; + + # detect references to other manual pages and set link + if (/^\s/) { # skip man headers / first line + s,((<[IB]>)?[\w\_\.\-]+(</[IB]>)?\(([1-9ln][a-zA-Z]*)\)),&mlnk($1),oige; + } # detect E-Mail Addreses in manpages if ( $enable_mailto_links && /\@/ ) {