Bug 85753 - man pages do not offer links to other man pages any more
Summary: man pages do not offer links to other man pages any more
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: man (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-23 09:04 UTC by Ferdinand Gassauer
Modified: 2007-12-18 11:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ferdinand Gassauer 2004-07-23 09:04:40 UTC
Version:           3.2.92 (using KDE 3.2.92 (3.3 beta2), compiled sources)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.95-smp

IIRC it was one of the nice things in previous versions to click through the referenced man pages
this does not work any more.
Comment 1 Ferdinand Gassauer 2004-07-23 09:29:24 UTC
I have found some links that work, but non in the "SEE ALSO" section, where it would be most useful
Comment 2 Ferdinand Gassauer 2004-07-23 09:57:24 UTC
Hmm, there are some man pages which do not work like "sudoers"
Comment 3 Stephan Kulow 2004-07-25 15:19:17 UTC
the sudoers man page put some specific markup between the name and the section, so the regexp doesn't catch it. I don't think it's too common to do that in man pages.
Comment 4 Nicolas Goutte 2005-05-19 10:45:08 UTC
Can you give other examples of man pages that do not work anymore?

(If we are to add hacks, better find a generic way than one matching only one page.)

Have a nice day!
Comment 5 Ferdinand Gassauer 2005-05-19 11:25:16 UTC
didn't find anything els, may be it makes more sens to contact the sudoers to conform to "strandards".
Comment 6 Stephan Kulow 2005-05-19 12:36:48 UTC
if you could stop reassigning random bug reports to me, it would be a big help
Comment 7 Nicolas Goutte 2005-05-19 22:11:55 UTC
To comment #5: the problems is that there is not real standards. The original man pages (of the type man(7)) where meant to display nicely. So finding text sequences that should be transformed to links is not easy.

(At least the other type, called mdoc(7), is more structured, so such problems happens less often.)

Have a nice day!
Comment 8 Nicolas Goutte 2005-06-01 10:59:27 UTC
For the archive: I have just noticed that rpm(8) has the same type of reference however it seems to work there. So probably for sudoers(5) the main problem is \|

(However this is just a little problem compared to the main problems of the current implementation of kio_man... unfortunately.)

Have a nice day!
Comment 9 Nicolas Goutte 2005-06-02 20:06:15 UTC
SVN commit 421302 by goutte:

Add support for references to man pages where a non-breaking space exists
between command and section number
(as using a non-breaking space in this case is even more logical than
using a normal space.)
BUG:85753


 M  +18 -10    man2html.cpp  


--- trunk/KDE/kdebase/kioslave/man/man2html.cpp #421301:421302
@@ -315,7 +315,7 @@
     s_stringDefinitionMap.insert( "Gt", StringDefinition( 1, ">" ) );
     s_stringDefinitionMap.insert( "Pm", StringDefinition( 1, "±" ) );
     s_stringDefinitionMap.insert( "If", StringDefinition( 1, "∞" ) );
-    s_stringDefinitionMap.insert( "Na", StringDefinition( 3, "NaN" ) ); // Not a Number ### TODO: does it exist in Unicode?
+    s_stringDefinitionMap.insert( "Na", StringDefinition( 3, "NaN" ) );
     s_stringDefinitionMap.insert( "Ba", StringDefinition( 1, "|" ) );
     // end mdoc-only
     // man(7)
@@ -778,7 +778,8 @@
 	    f=idtest[j];
 	    /* check section */
 	    g=strchr(f,')');
-	    if (g!=NULL && (g-f)<12 && (isalnum(f[-1]) || f[-1]=='>') &&
+            // The character before f must alphanumeric, the end of a HTML tag or the end of a &nbsp;
+            if (g!=NULL && f>c && (g-f)<12 && (isalnum(f[-1]) || f[-1]=='>' || ( f[-1] == ';' ) ) &&
 		isdigit(f[1]) && f[1]!='0' && ((g-f)<=2 || isalpha(f[2])))
 	    {
 		ok = TRUE;
@@ -792,14 +793,12 @@
 		    }
 		}
 	    }
-	    else ok = FALSE;
+            else
+                ok = false;
 
-	    if (ok)
-	    {
-		/* this might be a link */
-		h=f-1;
-  // ### TODO
-#if 0
+            h = f - 1;
+            if ( ok )
+            {
                 // Skip &nbsp;
                 kdDebug(7107) << "BEFORE SECTION:" <<  *h << endl;
                 if ( ( h > c + 5 ) && ( ! memcmp( h-5, "&nbsp;", 6 ) ) )
@@ -807,7 +806,16 @@
                     h -= 6;
                     kdDebug(7107) << "Skip &nbsp;" << endl;
                 }
-#endif
+                else if ( *h == ';' )
+                {
+                    // Not a non-breaking space, so probably not ok
+                    ok = false;
+                }
+            }
+            
+	    if (ok)
+	    {
+		/* this might be a link */
 		/* skip html makeup */
 		while (h>c && *h=='>') {
 		    while (h!=c && *h!='<') h--;