helpers/mimeTextPart.xsl
changeset 120 bb1c8a7b774c
parent 110 c81406884e16
     1.1 --- a/helpers/mimeTextPart.xsl	Thu Jul 05 13:19:19 2012 +0200
     1.2 +++ b/helpers/mimeTextPart.xsl	Wed Dec 31 12:07:40 2014 +0100
     1.3 @@ -1,4 +1,20 @@
     1.4  <?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!--
     1.6 +Copyright © 2014 František Kučera (frantovo.cz)
     1.7 +
     1.8 +This program is free software: you can redistribute it and/or modify
     1.9 +it under the terms of the GNU General Public License as published by
    1.10 +the Free Software Foundation, either version 3 of the License, or
    1.11 +(at your option) any later version.
    1.12 +
    1.13 +This program is distributed in the hope that it will be useful,
    1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 +GNU General Public License for more details.
    1.17 +
    1.18 +You should have received a copy of the GNU General Public License
    1.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.20 +-->
    1.21  <xsl:stylesheet version="2.0"
    1.22  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    1.23  	xmlns:fn="http://www.w3.org/2005/xpath-functions"
    1.24 @@ -79,6 +95,9 @@
    1.25  	</xsl:template>
    1.26  
    1.27  	
    1.28 +	<!--
    1.29 +		TODO: převzít odsazování z hellDesku?
    1.30 +	-->
    1.31  	<xsl:template match="h:blockquote/h:p">
    1.32  		<xsl:text>&gt; </xsl:text>
    1.33  		<xsl:apply-templates/>
    1.34 @@ -95,9 +114,12 @@
    1.35  	
    1.36  	
    1.37  	<xsl:template match="h:a">
    1.38 -		<xsl:text>'</xsl:text>
    1.39 -		<xsl:apply-templates select="node()"/>
    1.40 -		<xsl:text>' &lt;</xsl:text>
    1.41 +		<xsl:if test="not(text() = @href)">
    1.42 +			<xsl:text>'</xsl:text>
    1.43 +			<xsl:apply-templates select="node()"/>
    1.44 +			<xsl:text>' </xsl:text>
    1.45 +		</xsl:if>
    1.46 +		<xsl:text>&lt;</xsl:text>
    1.47  		<xsl:choose>
    1.48  			<xsl:when test="matches(@href, '^(http:|https:|ftp:)')">
    1.49  				<xsl:value-of select="@href"/>
    1.50 @@ -155,6 +177,9 @@
    1.51  	</xsl:template>
    1.52  	
    1.53  	
    1.54 +	<!--
    1.55 +		TODO: převzít odsazování z hellDesku?
    1.56 +	-->
    1.57  	<xsl:template match="h:pre">
    1.58  		<xsl:text>--------------------------------</xsl:text>
    1.59  		<xsl:text>&#10;</xsl:text>
    1.60 @@ -207,7 +232,7 @@
    1.61  			<xsl:if test="$úroveň = 0 or not(position() = last())">
    1.62  				<xsl:text>&#10;</xsl:text>
    1.63  			</xsl:if>
    1.64 -		</xsl:for-each>		
    1.65 +		</xsl:for-each>
    1.66  		
    1.67  		<xsl:if test="$úroveň = 0">
    1.68  			<xsl:text>&#10;</xsl:text>
    1.69 @@ -216,7 +241,7 @@
    1.70  	
    1.71  	
    1.72  	<xsl:template match="text()[not(parent::h:pre)]">
    1.73 -		<xsl:if test="matches(., '^\s') and preceding-sibling::node()">
    1.74 +		<xsl:if test="matches(., '^\s') and preceding-sibling::node() and not(preceding-sibling::h:br)">
    1.75  			<xsl:text> </xsl:text>
    1.76  		</xsl:if>
    1.77  		<xsl:value-of select="normalize-space(.)"/>