]> granicus.if.org Git - apache/commitdiff
add more escaping for urls
authorAndré Malo <nd@apache.org>
Thu, 23 Jan 2014 11:20:34 +0000 (11:20 +0000)
committerAndré Malo <nd@apache.org>
Thu, 23 Jan 2014 11:20:34 +0000 (11:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560640 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/latex/html.xsl

index c77f1ec3a92936e877a0881c98a3f16b7d1dba97..3e8dd65e847693ae63557aca6018b80b3d5e2632 100644 (file)
@@ -261,14 +261,26 @@ interpreted in pre -->
 </xsl:variable>
 <xsl:choose>
 
-<xsl:when test="starts-with(@href, 'http:') or starts-with(@href, 'news:') or starts-with(@href, 'mailto:')">
+<xsl:when test="starts-with(@href, 'http:') or starts-with(@href, 'https:') or starts-with(@href, 'news:') or starts-with(@href, 'mailto:')">
   <xsl:if test="not(.=@href)">
     <xsl:text>\footnote{</xsl:text>
       <xsl:text>\href{</xsl:text>
       <xsl:call-template name="replace-string">
-        <xsl:with-param name="text" select="@href"/>
-        <xsl:with-param name="replace" select="'#'"/>
-        <xsl:with-param name="with" select="'\#'"/>
+        <xsl:with-param name="replace" select="'%'"/>
+        <xsl:with-param name="with" select="'\%'"/>
+        <xsl:with-param name="text">
+          <xsl:call-template name="replace-string">
+            <xsl:with-param name="replace" select="'_'"/>
+            <xsl:with-param name="with" select="'\_'"/>
+            <xsl:with-param name="text">
+              <xsl:call-template name="replace-string">
+                <xsl:with-param name="replace" select="'#'"/>
+                <xsl:with-param name="with" select="'\#'"/>
+                <xsl:with-param name="text" select="@href"/>
+              </xsl:call-template>
+            </xsl:with-param>
+          </xsl:call-template>
+        </xsl:with-param>
       </xsl:call-template>
       <xsl:text>}{</xsl:text>
     <xsl:call-template name="ltescape">