aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_docgen/priv/xsl/db_html.xsl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2012-07-05 10:19:00 +0200
committerHans Bolinder <[email protected]>2012-07-11 08:15:11 +0200
commitfcf0e43a4fe06fc3f44fbff96ee42378a479d35f (patch)
tree27de2f78e8a59b8dc60392641631c5e7cf60fff2 /lib/erl_docgen/priv/xsl/db_html.xsl
parenteac9c3494ce4d684b09779f075317e8943a7928b (diff)
downloadotp-fcf0e43a4fe06fc3f44fbff96ee42378a479d35f.tar.gz
otp-fcf0e43a4fe06fc3f44fbff96ee42378a479d35f.tar.bz2
otp-fcf0e43a4fe06fc3f44fbff96ee42378a479d35f.zip
Fix a bug regarding spaces in C function prototypes
Thanks to Richard O'Keefe for pointing the bug out.
Diffstat (limited to 'lib/erl_docgen/priv/xsl/db_html.xsl')
-rw-r--r--lib/erl_docgen/priv/xsl/db_html.xsl21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl
index 7cf5465f90..4bc5abb364 100644
--- a/lib/erl_docgen/priv/xsl/db_html.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html.xsl
@@ -1817,7 +1817,14 @@
<xsl:choose>
<xsl:when test="ancestor::cref">
- <a name="{substring-before(nametext, '(')}"><span class="bold_code"><xsl:value-of select="ret"/><xsl:text> </xsl:text><xsl:value-of select="nametext"/></span></a><br/>
+ <a name="{substring-before(nametext, '(')}">
+ <span class="bold_code">
+ <xsl:value-of select="ret"/>
+ <xsl:call-template name="maybe-space-after-ret">
+ <xsl:with-param name="s" select="ret"/>
+ </xsl:call-template>
+ <xsl:value-of select="nametext"/>
+ </span></a><br/>
</xsl:when>
<xsl:when test="ancestor::erlref">
<xsl:variable name="fname">
@@ -1845,6 +1852,18 @@
</xsl:template>
+ <xsl:template name="maybe-space-after-ret">
+ <xsl:param name="s"/>
+ <xsl:variable name="last_char"
+ select="substring($s, string-length($s), 1)"/>
+ <xsl:choose>
+ <xsl:when test="$last_char != '*'">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+
<!-- Type -->
<xsl:template match="type">
<xsl:param name="partnum"/>