# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1420024060 -3600
# Node ID bb1c8a7b774c1919bdf7552ddbd7ed689b591a6b
# Parent  f5b57e221e388499c94d9a48c768ce4b60dc9867
XSLT: licence – GNU GPLv3

diff -r f5b57e221e38 -r bb1c8a7b774c helpers/mimeTextPart.xsl
--- a/helpers/mimeTextPart.xsl	Thu Jul 05 13:19:19 2012 +0200
+++ b/helpers/mimeTextPart.xsl	Wed Dec 31 12:07:40 2014 +0100
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2014 František Kučera (frantovo.cz)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
 <xsl:stylesheet version="2.0"
 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
@@ -79,6 +95,9 @@
 	</xsl:template>
 
 	
+	<!--
+		TODO: převzít odsazování z hellDesku?
+	-->
 	<xsl:template match="h:blockquote/h:p">
 		<xsl:text>&gt; </xsl:text>
 		<xsl:apply-templates/>
@@ -95,9 +114,12 @@
 	
 	
 	<xsl:template match="h:a">
-		<xsl:text>'</xsl:text>
-		<xsl:apply-templates select="node()"/>
-		<xsl:text>' &lt;</xsl:text>
+		<xsl:if test="not(text() = @href)">
+			<xsl:text>'</xsl:text>
+			<xsl:apply-templates select="node()"/>
+			<xsl:text>' </xsl:text>
+		</xsl:if>
+		<xsl:text>&lt;</xsl:text>
 		<xsl:choose>
 			<xsl:when test="matches(@href, '^(http:|https:|ftp:)')">
 				<xsl:value-of select="@href"/>
@@ -155,6 +177,9 @@
 	</xsl:template>
 	
 	
+	<!--
+		TODO: převzít odsazování z hellDesku?
+	-->
 	<xsl:template match="h:pre">
 		<xsl:text>--------------------------------</xsl:text>
 		<xsl:text>&#10;</xsl:text>
@@ -207,7 +232,7 @@
 			<xsl:if test="$úroveň = 0 or not(position() = last())">
 				<xsl:text>&#10;</xsl:text>
 			</xsl:if>
-		</xsl:for-each>		
+		</xsl:for-each>
 		
 		<xsl:if test="$úroveň = 0">
 			<xsl:text>&#10;</xsl:text>
@@ -216,7 +241,7 @@
 	
 	
 	<xsl:template match="text()[not(parent::h:pre)]">
-		<xsl:if test="matches(., '^\s') and preceding-sibling::node()">
+		<xsl:if test="matches(., '^\s') and preceding-sibling::node() and not(preceding-sibling::h:br)">
 			<xsl:text> </xsl:text>
 		</xsl:if>
 		<xsl:value-of select="normalize-space(.)"/>
diff -r f5b57e221e38 -r bb1c8a7b774c helpers/mimeXhtmlPart-make-paragraphs.xsl
--- a/helpers/mimeXhtmlPart-make-paragraphs.xsl	Thu Jul 05 13:19:19 2012 +0200
+++ b/helpers/mimeXhtmlPart-make-paragraphs.xsl	Wed Dec 31 12:07:40 2014 +0100
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2014 František Kučera (frantovo.cz)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
 <xsl:stylesheet version="2.0"
 	xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:h="http://www.w3.org/1999/xhtml"
diff -r f5b57e221e38 -r bb1c8a7b774c helpers/mimeXhtmlPart.xsl
--- a/helpers/mimeXhtmlPart.xsl	Thu Jul 05 13:19:19 2012 +0200
+++ b/helpers/mimeXhtmlPart.xsl	Wed Dec 31 12:07:40 2014 +0100
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2014 František Kučera (frantovo.cz)
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
 <xsl:stylesheet version="2.0"
 	xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:h="http://www.w3.org/1999/xhtml"
@@ -75,7 +91,7 @@
 			</head>
 			<body>
 				<xsl:if test="$title and $isRoot">
-					<h1><xsl:value-of select="$title"/></h1>			
+					<h1><xsl:value-of select="$title"/></h1>
 				</xsl:if>
 								
 				<xsl:apply-templates select="h:html/h:body"/>