aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/StudioIntegration
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/StudioIntegration')
-rw-r--r--LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt28
1 files changed, 24 insertions, 4 deletions
diff --git a/LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt b/LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt
index 111b75aae..f1e923988 100644
--- a/LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt
+++ b/LUFA/StudioIntegration/HV1/lufa_docbook_transform.xslt
@@ -729,19 +729,39 @@
<xsl:template match="programlisting">
<programlisting language="c">
- <xsl:for-each select="codeline[position() > 1 or highlight]">
- <xsl:apply-templates select="."/>
- <xsl:text>&#10;</xsl:text>
- </xsl:for-each>
+ <xsl:apply-templates/>
</programlisting>
</xsl:template>
+ <xsl:template match="codeline">
+ <xsl:apply-templates/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="codeline[last()]">
+ <xsl:if test="text() != '*'">
+ <xsl:apply-templates/>
+ </xsl:if>
+ </xsl:template>
+
<xsl:template match="highlight">
<emphasis role="{@class}">
<xsl:apply-templates/>
</emphasis>
</xsl:template>
+ <xsl:template match="highlight[1]/text()">
+ <xsl:choose>
+ <xsl:when test="substring(., 1, 1) = '*'">
+ <xsl:value-of select="substring(., 2)"/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template match="sp[ancestor::codeline]">
<xsl:text> </xsl:text>
</xsl:template>