]> granicus.if.org Git - docbook-dsssl/commitdiff
Move square brackets and <sup> inside <a> element for footnote
authorBob Stayton <bobs@sagehill.net>
Mon, 20 Feb 2012 18:15:57 +0000 (18:15 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 20 Feb 2012 18:15:57 +0000 (18:15 +0000)
marks to fix display problems in some browsers.

xsl/html/footnote.xsl

index 6804113ac76f24b44a9fd1bc150add8b7aee3161..d00c91ec9c0f62297b88582d5a16b909e401809a 100644 (file)
 
   <xsl:choose>
     <xsl:when test="ancestor::table or ancestor::informaltable">
-      <sup>
-        <xsl:text>[</xsl:text>
-        <a name="{$name}" href="{$href}">
-          <xsl:apply-templates select="." mode="class.attribute"/>
+      <a name="{$name}" href="{$href}">
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <sup>
+          <xsl:text>[</xsl:text>
           <xsl:apply-templates select="." mode="footnote.number"/>
-        </a>
-        <xsl:text>]</xsl:text>
-      </sup>
+          <xsl:text>]</xsl:text>
+        </sup>
+      </a>
     </xsl:when>
     <xsl:otherwise>
-      <sup>
-        <xsl:text>[</xsl:text>
-        <a name="{$name}" href="{$href}">
-          <xsl:apply-templates select="." mode="class.attribute"/>
+      <a name="{$name}" href="{$href}">
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <sup>
+          <xsl:text>[</xsl:text>
           <xsl:apply-templates select="." mode="footnote.number"/>
-        </a>
-        <xsl:text>]</xsl:text>
-      </sup>
+          <xsl:text>]</xsl:text>
+        </sup>
+      </a>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
@@ -72,14 +72,14 @@ linkend/id: <xsl:value-of select="@linkend"/>
     <xsl:value-of select="substring-after($target.href, '#')"/>
   </xsl:variable>
 
-  <sup>
-    <xsl:text>[</xsl:text>
-    <a href="{$href}">
-      <xsl:apply-templates select="." mode="class.attribute"/>
+  <a href="{$href}">
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <sup>
+      <xsl:text>[</xsl:text>
       <xsl:apply-templates select="$footnote" mode="footnote.number"/>
-    </a>
-    <xsl:text>]</xsl:text>
-  </sup>
+      <xsl:text>]</xsl:text>
+    </sup>
+  </a>
 </xsl:template>
 
 <xsl:template match="footnote" mode="footnote.number">
@@ -145,14 +145,14 @@ linkend/id: <xsl:value-of select="@linkend"/>
       </xsl:if>
     </xsl:with-param>
     <xsl:with-param name="content">
-      <sup>
-        <xsl:text>[</xsl:text>
-        <a id="{$name}" href="{$href}">
-          <xsl:apply-templates select="." mode="class.attribute"/>
+      <a id="{$name}" href="{$href}">
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <sup>
+          <xsl:text>[</xsl:text>
           <xsl:apply-templates select="ancestor::footnote" mode="footnote.number"/>
-        </a>
-        <xsl:text>] </xsl:text>
-      </sup>
+          <xsl:text>] </xsl:text>
+        </sup>
+      </a>
       <xsl:apply-templates/>
     </xsl:with-param>
   </xsl:call-template>
@@ -175,15 +175,15 @@ linkend/id: <xsl:value-of select="@linkend"/>
     </xsl:call-template>
   </xsl:variable>
   <xsl:variable name="footnote.mark">
-    <sup>
-      <xsl:text>[</xsl:text>
-      <a name="{$name}" href="{$href}">
-        <xsl:apply-templates select="." mode="class.attribute"/>
+    <a name="{$name}" href="{$href}">
+      <xsl:apply-templates select="." mode="class.attribute"/>
+      <sup>
+        <xsl:text>[</xsl:text>
         <xsl:apply-templates select="ancestor::footnote"
                              mode="footnote.number"/>
-      </a>
-      <xsl:text>] </xsl:text>
-    </sup>
+        <xsl:text>] </xsl:text>
+      </sup>
+    </a>
   </xsl:variable>
 
   <xsl:variable name="html">