<xsl:param name='source-uri'
select='"//git.draconx.ca/gitweb/homepage.git/blob/"' />
<xsl:param name='site-title' select='"The Citrine Citadel"' />
+<xsl:param name='section-links' select='//document/section-links' />
<func:function name='f:ends-with'>
<xsl:param name='a' />
<xsl:when test='ancestor::xhtml:pre'><xsl:copy /></xsl:when>
<!-- preserve whitespace which is the only child node of an element -->
<xsl:when test='count(../node()) = 1'><xsl:copy /></xsl:when>
+ <!-- preserve whitespace between consecutive span-level elements
+ which have at least one non-whitespace sibling text element -->
+ <xsl:when test='f:element-is-span(preceding-sibling::node()[1])
+ and f:element-is-span(following-sibling::node()[1])
+ and ../text()[normalize-space(.) != ""]'>
+ <xsl:copy />
+ </xsl:when>
</xsl:choose>
</xsl:template>
<xsl:variable name='fragment' select='concat("#", @id)' />
<xsl:copy>
<xsl:apply-templates select='node()|@*' />
- <xsl:text> </xsl:text>
- <small class='permalink'>
- (<a href='{$fragment}'><xsl:value-of select='$fragment' /></a>)
- </small>
+ <xsl:if test='$section-links = "yes"'>
+ <xsl:text> </xsl:text>
+ <small class='permalink'>
+ (<a href='{$fragment}'><xsl:value-of select='$fragment' /></a>)
+ </small>
+ </xsl:if>
</xsl:copy>
</xsl:template>