git: 71469bf91c - main - more restrict manual page reference detection

Wolfram Schneider <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=71469bf91c731b378644a77c9823f2c0310ed11b

commit 71469bf91c731b378644a77c9823f2c0310ed11b
Author:     Wolfram Schneider <[email protected]>
AuthorDate: 2022-02-05 16:52:39 +0000
Commit:     Wolfram Schneider <[email protected]>
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&amp;manpath=freebsd-release-ports&amp;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 && /\@/ ) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.