Skip to content

Commit

Permalink
Fix image template
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-jung committed Jan 9, 2024
1 parent 1091f3c commit 6bd010d
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion xsl/reveal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,51 @@
</pre>
</xsl:template>

<xsl:template match="*[contains(@class, ' slide/slide-image ')]">
<!--<xsl:template match="*[contains(@class, ' slide/slide-image ')]">
<img src="{@href}">
<xsl:copy-of select="@style"/>
<xsl:apply-templates/>
</img>
</xsl:template>-->

<xsl:template name="topic-image">
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<img>
<!-- Copy style attribute -->
<xsl:copy-of select="@style"/>
<xsl:call-template name="commonattributes">
<xsl:with-param name="default-output-class">
<xsl:if test="@placement = 'break'"><!--Align only works for break-->
<xsl:choose>
<xsl:when test="@align = 'left'">imageleft</xsl:when>
<xsl:when test="@align = 'right'">imageright</xsl:when>
<xsl:when test="@align = 'center'">imagecenter</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="setid"/>
<xsl:choose>
<xsl:when test="*[contains(@class, ' topic/longdescref ')]">
<xsl:apply-templates select="*[contains(@class, ' topic/longdescref ')]"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="@longdescref"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="@href|@height|@width"/>
<xsl:apply-templates select="@scale"/>
<xsl:choose>
<xsl:when test="*[contains(@class, ' topic/alt ')]">
<xsl:variable name="alt-content"><xsl:apply-templates select="*[contains(@class, ' topic/alt ')]" mode="text-only"/></xsl:variable>
<xsl:attribute name="alt" select="normalize-space($alt-content)"/>
</xsl:when>
<xsl:when test="@alt">
<xsl:attribute name="alt" select="@alt"/>
</xsl:when>
</xsl:choose>
</img>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
</xsl:template>

<xsl:template match="*[contains(@class, ' slide/slide-p ')]">
Expand Down

0 comments on commit 6bd010d

Please sign in to comment.