** Changed in: yelp (Ubuntu)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to yelp in Ubuntu.
https://bugs.launchpad.net/bugs/544537

Title:
  Invalid man links

Status in The Yelp Help Browser for Gnome:
  Unknown
Status in “yelp” package in Ubuntu:
  Fix Released

Bug description:
  Binary package hint: yelp

  OS : Ubuntu 9.10
  Yelp : 2.28.0

  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/yelp/+bug/544537/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to