summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xsl/common.xsl11
1 files changed, 7 insertions, 4 deletions
diff --git a/xsl/common.xsl b/xsl/common.xsl
index 007d8a2..ed5c0f1 100644
--- a/xsl/common.xsl
+++ b/xsl/common.xsl
@@ -28,10 +28,13 @@
doctype-system="about:legacy-compat"
/>
- <!--
- Removes leading and traling spaces, that we probably need!
- <xsl:template match="text()" mode="html"><xsl:value-of select="normalize-space(.)"/></xsl:template>
- -->
+ <xsl:template match="text()" mode="html">
+ <!-- Add leading whitespace, if needed -->
+ <xsl:if test="not(substring(., 1, 1) = normalize-space(substring(., 1, 1)))"><xsl:text> </xsl:text></xsl:if>
+ <xsl:value-of select="normalize-space(.)"/>
+ <!-- Add trailing whitespace, if needed -->
+ <xsl:if test="not(substring(., string-length(.), 1) = normalize-space(substring(., string-length(.), 1)))"><xsl:text> </xsl:text></xsl:if>
+ </xsl:template>
<xsl:template match="html:*" mode="html">
<xsl:copy>