# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1318873823 -7200
# Node ID 70286a6cf3382d739c99afd70feb209cdd706817
# Parent  2ed2497d4559f1f5b65724fe665c85e1905cb8f5
Drupal: text/plain – podpora obrázků a dalších vnořených elementů uvnitř odkazů.

diff -r 2ed2497d4559 -r 70286a6cf338 bin/sonews.sh
--- a/bin/sonews.sh	Mon Oct 17 19:12:42 2011 +0200
+++ b/bin/sonews.sh	Mon Oct 17 19:50:23 2011 +0200
@@ -9,9 +9,12 @@
 $NEWSROOT/lib/commons-codec-1.5.jar:\
 $NEWSROOT/lib/mysql-connector-java.jar:\
 $NEWSROOT/lib/javax.mail.jar:\
+$NEWSROOT/lib/saxon.jar:\
 $NEWSROOT/lib/postgresql-8.3-604.jdbc4.jar:\
 $NEWSROOT/lib/mysql-connector-java-5.1.7-bin.jar
 
+JAVA_OPTIONS="-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl";
+
 LOGFILE=var/log/sonews.log
 PIDFILE=var/pid/sonews.pid
 ARGS=$@
@@ -23,7 +26,7 @@
 case "$1" in
   start)
     echo "Starting sonews Newsserver..."
-    $JAVA -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
+    $JAVA $JAVA_OPTIONS -classpath $CLASSPATH $MAINCLASS $ARGS &> $LOGFILE &
     echo $! > $PIDFILE
     ;;
   stop)
diff -r 2ed2497d4559 -r 70286a6cf338 helpers/mimeTextPart.xsl
--- a/helpers/mimeTextPart.xsl	Mon Oct 17 19:12:42 2011 +0200
+++ b/helpers/mimeTextPart.xsl	Mon Oct 17 19:50:23 2011 +0200
@@ -10,12 +10,14 @@
 	<xsl:strip-space elements="*"/>
 	
 	<xsl:variable name="urlBase" select="/h:html/h:head/h:base/@href"/>
+
 	
 	<!-- Celý dokument -->
 	<xsl:template match="/">
 		<xsl:apply-templates select="h:html/h:body"/>
 	</xsl:template>
 
+
 	<xsl:template match="h:h1">
 		<xsl:value-of select="text()"/>
 		<xsl:text>&#10;</xsl:text>
@@ -24,6 +26,7 @@
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:h2">
 		<xsl:value-of select="text()"/>
 		<xsl:text>&#10;</xsl:text>
@@ -32,6 +35,7 @@
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:h3">
 		<xsl:for-each select="1 to 3">#</xsl:for-each>
 		<xsl:text> </xsl:text>
@@ -39,7 +43,7 @@
 		<xsl:text>&#10;</xsl:text>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
-
+	
 	
 	<xsl:template match="h:h4">
 		<xsl:for-each select="1 to 4">#</xsl:for-each>
@@ -48,7 +52,7 @@
 		<xsl:text>&#10;</xsl:text>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
-
+	
 	
 	<xsl:template match="h:h5">
 		<xsl:for-each select="1 to 5">#</xsl:for-each>
@@ -58,6 +62,7 @@
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:h6">
 		<xsl:for-each select="1 to 6">#</xsl:for-each>
 		<xsl:text> </xsl:text>
@@ -72,6 +77,7 @@
 		<xsl:text>&#10;</xsl:text>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
+
 	
 	<xsl:template match="h:blockquote/h:p">
 		<xsl:text>&gt; </xsl:text>
@@ -80,9 +86,10 @@
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:a">
 		<xsl:text>"</xsl:text>
-		<xsl:value-of select="text()"/>
+		<xsl:apply-templates select="node()"/>
 		<xsl:text>" &lt;</xsl:text>
 		<xsl:choose>
 			<xsl:when test="matches(@href, '^(http:|https:|ftp:)')">
@@ -110,6 +117,7 @@
 		</xsl:if>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:img">
 		<xsl:variable name="obrázek">
 			<h:a href="{@src}" title="{@title}">Obrázek: <xsl:value-of select="@alt"/></h:a>
@@ -117,18 +125,21 @@
 		<xsl:apply-templates select="$obrázek/node()"/>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:strong|h:b">
 		<xsl:text>**</xsl:text>
 		<xsl:apply-templates/>
 		<xsl:text>**</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:em|h:i">
 		<xsl:text>*</xsl:text>
 		<xsl:apply-templates/>
 		<xsl:text>*</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:abbr[@title]">
 		<xsl:apply-templates/>
 		<xsl:text> (</xsl:text>
@@ -136,6 +147,7 @@
 		<xsl:text>)</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:pre">
 		<xsl:text>--------------------------------</xsl:text>
 		<xsl:text>&#10;</xsl:text>
@@ -146,29 +158,34 @@
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:code">
 		<xsl:text>`</xsl:text>
 		<xsl:apply-templates/>
 		<xsl:text>`</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:hr">
 		<xsl:text>----------------------------------------------------------------</xsl:text>
 		<xsl:text>&#10;</xsl:text>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:ul">
 		<xsl:apply-templates/>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:ul/h:li">
 		<xsl:text> - </xsl:text>
 		<xsl:apply-templates/>
 		<xsl:text>&#10;</xsl:text>
 	</xsl:template>
 	
+	
 	<xsl:template match="h:ol">
 		<xsl:for-each select="h:li">
 			<xsl:value-of select="concat(' ', position(), ') ')"/>
@@ -179,12 +196,6 @@
 	</xsl:template>
 	
 	
-	<!--
-	<xsl:template match="h:blockquote[matches(p/text(), '^(\"|„)')]">
-		
-	</xsl:template>
-	-->
-	
 	<xsl:template match="text()[not(parent::h:pre)]">
 		<xsl:if test="matches(., '^\s')">
 			<xsl:text> </xsl:text>
@@ -197,6 +208,10 @@
 
 	
 	<xsl:template match="h:div[@class='wwwLinks']">
+		<!-- 
+			Dvě pomlčky a mezeru budou e-maliloví klienti považovat za začátek podpisu
+			a zobrazí ho šedivým písmem a nebudou ho citovat v odpovědích.
+		-->
 		<xsl:text>-- </xsl:text>
 		<xsl:text>&#10;</xsl:text>
 		<xsl:apply-templates/>