Skip to content

Commit 73534ce

Browse files
author
Sanders Kleinfeld
committed
Merge pull request #132 from oreillymedia/figs
Refactored figure.border.div handling
2 parents 43dc582 + b89c9b7 commit 73534ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

htmlbook-xsl/elements.xsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@
118118
<!-- Switch to the appropriate context node -->
119119
<xsl:for-each select="$node[1]">
120120
<xsl:choose>
121-
<xsl:when test="$figure.border.div = 1 and h:figcaption">
121+
<xsl:when test="$figure.border.div = 1 and h:figcaption[text()]">
122122
<!-- figcaption must be first or last; handle accordingly -->
123123
<xsl:choose>
124124
<!-- Only do border box when you've got a nonempty fig caption -->
125-
<xsl:when test="*[1][self::h:figcaption[text()]]">
125+
<xsl:when test="*[1][self::h:figcaption]">
126126
<xsl:apply-templates select="h:figcaption"/>
127127
<div class="border-box">
128128
<xsl:apply-templates select="*[not(self::h:figcaption)]"/>
@@ -141,7 +141,7 @@
141141
<xsl:with-param name="message">
142142
<xsl:text>Warning: figcaption for figure </xsl:text>
143143
<xsl:value-of select="@id"/>
144-
<xsl:text> either missing, empty, or not at beginning or end of figure. Unable to add border box</xsl:text>
144+
<xsl:text>not at beginning or end of figure. Unable to add border box</xsl:text>
145145
</xsl:with-param>
146146
</xsl:call-template>
147147
<xsl:apply-templates/>

0 commit comments

Comments
 (0)