summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ee0286d)
We don't generally want to delete whitespace between span elements.
An exception is made if all sibling text nodes are whitespace, in
which case they should all be removed to allow indentation.
<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>
<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:choose>
</xsl:template>