]> git.draconx.ca Git - homepage.git/blobdiff - layouts/default.xsl
Adjust whitespace preservation rules.
[homepage.git] / layouts / default.xsl
index f95a2c77805811d0a477025474f996ac50fd59b2..eaeef724f3411cb14ea63a5b6e7593d8fefc0423 100644 (file)
     <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>