ソースを参照

Trying to prevent a potential infinite template recursion when using hyphenate-url on inline tags thas was noticed when rendering BLFS.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8043 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 年 前
コミット
64fb301a9f
1 ファイル変更22 行追加8 行削除
  1. 22 8
      pdf/lfs-mixed.xsl

+ 22 - 8
pdf/lfs-mixed.xsl

@@ -123,11 +123,18 @@
     <xsl:param name="content">
       <xsl:call-template name="simple.xlink">
         <xsl:with-param name="content">
-          <xsl:call-template name="hyphenate-url">
-            <xsl:with-param name="url">
+          <xsl:choose>
+            <xsl:when test="ancestor::para and not(descendant::ulink)">
+              <xsl:call-template name="hyphenate-url">
+                <xsl:with-param name="url">
+                  <xsl:apply-templates/>
+                </xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
               <xsl:apply-templates/>
-            </xsl:with-param>
-          </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
         </xsl:with-param>
       </xsl:call-template>
     </xsl:param>
@@ -152,11 +159,18 @@
     <xsl:param name="content">
       <xsl:call-template name="simple.xlink">
         <xsl:with-param name="content">
-          <xsl:call-template name="hyphenate-url">
-            <xsl:with-param name="url">
+          <xsl:choose>
+            <xsl:when test="ancestor::para and not(descendant::ulink)">
+              <xsl:call-template name="hyphenate-url">
+                <xsl:with-param name="url">
+                  <xsl:apply-templates/>
+                </xsl:with-param>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
               <xsl:apply-templates/>
-            </xsl:with-param>
-          </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
         </xsl:with-param>
       </xsl:call-template>
     </xsl:param>