GNOME Bugzilla – Bug 638265
Invalid man links
Last modified: 2011-01-13 21:03:43 UTC
Man page links do not work when there is no character afer the section number in the man file. For example, a man code like this : .Xr ssh 1 produces a Xml like this : <Xr>ssh 1</Xr> so, the XSL transformation "fails" and produce an invalid link as following : ssh() This bug appears when there are no space + another character after the section number in the man file. I managed to fix it by changing the man2html.xsl. File : man2html.xsl Line : 322 <!-- Cross reference --> <xsl:template match="Xr"> <xsl:variable name="manpage" select="substring-before(string(.), ' ')"/> <xsl:variable name="sectiontmp" select="substring-before(substring-after(string(.), ' '), ' ')"/> <xsl:variable name="extra" select="substring-after(substring-after(string(.), ' '), ' ')"/> <xsl:choose> <xsl:when test="$sectiontmp=''"> <xsl:variable name="section" select="substring-after(string(.), ' ')"/> <a> <xsl:attribute name="href"> <xsl:text>man:</xsl:text> <xsl:value-of select="$manpage"/> <xsl:text>(</xsl:text> <xsl:value-of select="$section"/> <xsl:text>)</xsl:text> </xsl:attribute> <xsl:value-of select="$manpage"/> <xsl:text>(</xsl:text> <xsl:value-of select="$section"/> <xsl:text>)</xsl:text> </a> </xsl:when> <xsl:when test="$sectiontmp!=''"> <xsl:variable name="section" select="$sectiontmp"/> <a> <xsl:attribute name="href"> <xsl:text>man:</xsl:text> <xsl:value-of select="$manpage"/> <xsl:text>(</xsl:text> <xsl:value-of select="$section"/> <xsl:text>)</xsl:text> </xsl:attribute> <xsl:value-of select="$manpage"/> <xsl:text>(</xsl:text> <xsl:value-of select="$section"/> <xsl:text>)</xsl:text> </a> </xsl:when> </xsl:choose> <xsl:value-of select="$extra"/> </xsl:template> I did not find another way that duplicate the code.
Hi, Thanks for reporting the problem. Are you able to compile the latest git version? We've recently completely rewritten the man-page parsing code and the problem above definitely won't happen in the same way. However, there might still be another bug in how we parse the given man page. Could you check it? Or otherwise send a copy of the relevant man page as a bug or to gnome-doc-devel-list@gnome.org so we can check the problem's fixed. Thanks, Rupert
Hi, I have just compiled the latest version of yelp from the git repository. No man links appear with this version, may be this functionality is not implemented yet ? Or may be i did something wrong when compiling ?
(In reply to comment #2) > I have just compiled the latest version of yelp from the git repository. > No man links appear with this version Where should they appear, and after doing what exactly?
Hi, Firstly, I misunderstood the original bug report. I thought that the following: > so, the XSL transformation "fails" and produce an invalid link as following : > > ssh() > > This bug appears when there are no space + another character after the section > number in the man file. meant that the text "ssh(1)" didn't appear at all in the rendered man page. This has been fixed in master. But there's better news! There is a series of patches on gnome-doc-devel[1] making actual blue <a href...> links out of the links. Hopefully they (or similar) will get applied to master soon, but they should apply cleanly now. Rupert [1] http://thread.gmane.org/gmane.comp.gnome.documentation.devel/524/focus=530
The patches I linked to above have now been committed to the tree, so this bug is fixed in git master. Yay!
I confirm, this bug is fixed in the lastest git master version. Keep up the good work ! Thanks