]> git.draconx.ca Git - homepage.git/blobdiff - layouts/default.xsl
Tweak whitespace-preserving templates.
[homepage.git] / layouts / default.xsl
index 020d1fdc61bd89728a910eb97587f052345eaf89..bfe9101a6bb4c55444dd5171d5b39366f566220a 100644 (file)
   <xsl:call-template name='glue-preceding-span' />
   <xsl:copy>
     <xsl:apply-templates select='node()|@*' />
-    <xsl:text>&#x2060;</xsl:text> <!-- avoid breaking within a span element -->
+    <xsl:if test='*'>
+      <!-- avoid breaking within a span element -->
+      <xsl:text>&#x2060;</xsl:text>
+    </xsl:if>
   </xsl:copy>
 </xsl:template>
 
     </xsl:when>
     <!-- preserve anything under <pre> -->
     <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:choose>
 </xsl:template>
 
     <head>
       <meta name='viewport' content='width=device-width, initial-scale=1' />
       <link rel='stylesheet' type='text/css' href='/style.css' />
+      <link rel="icon" href="data:," />
       <title>
         <xsl:variable name='page-title' select='string(/document/title)' />
         <xsl:if test='$page-title and $site-title != $page-title'>