diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2016-07-05 09:42:39 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2016-07-05 09:44:21 +0200 |
commit | b7d235d3690b85a0e1947d73f22d2d3ade8812fb (patch) | |
tree | bade9ec78e43c1a785bd4eaa8196a69404889fac /xsl | |
parent | ec83b34a8f2ab92966ecbfc196245f5965306484 (diff) | |
download | mutti-web-b7d235d3690b85a0e1947d73f22d2d3ade8812fb.tar.gz mutti-web-b7d235d3690b85a0e1947d73f22d2d3ade8812fb.tar.bz2 mutti-web-b7d235d3690b85a0e1947d73f22d2d3ade8812fb.zip |
Minize whitespace
..but keep leading and trailing whitespace
Diffstat (limited to 'xsl')
-rw-r--r-- | xsl/common.xsl | 11 |
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> |