After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 638265 - Invalid man links
Invalid man links
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: Man Pages
2.91.x
Other Linux
: Normal minor
: Yelp 3.0
Assigned To: Yelp maintainers
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-29 13:06 UTC by fabengb
Modified: 2011-01-13 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description fabengb 2010-12-29 13:06:09 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.
Comment 1 Rupert Swarbrick 2011-01-05 14:10:06 UTC
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
Comment 2 fabengb 2011-01-07 10:20:03 UTC
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 ?
Comment 3 André Klapper 2011-01-07 12:34:07 UTC
(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?
Comment 4 Rupert Swarbrick 2011-01-07 13:03:36 UTC
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
Comment 5 Rupert Swarbrick 2011-01-12 23:59:31 UTC
The patches I linked to above have now been committed to the tree, so this bug is fixed in git master. Yay!
Comment 6 fabengb 2011-01-13 21:03:43 UTC
I confirm, this bug is fixed in the lastest git master version.

Keep up the good work !

Thanks