mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
FB2 Input: Better handling of inline images. Fixes #989869 (fb2: export/display: inline images displayed as top level)
This commit is contained in:
parent
7e00bcd456
commit
bf6eda95ab
@ -377,7 +377,7 @@
|
||||
<xsl:apply-templates/><br/>
|
||||
</xsl:template>
|
||||
<!-- image -->
|
||||
<xsl:template match="fb:image">
|
||||
<xsl:template match="fb:body/fb:image|fb:section/fb:image">
|
||||
<div align="center">
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="border">1</xsl:attribute>
|
||||
@ -395,4 +395,20 @@
|
||||
</xsl:element>
|
||||
</div>
|
||||
</xsl:template>
|
||||
<xsl:template match="fb:image">
|
||||
<xsl:element name="img">
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with(@xlink:href,'#')">
|
||||
<xsl:attribute name="src"><xsl:value-of select="substring-after(@xlink:href,'#')"/></xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="src"><xsl:value-of select="@xlink:href"/></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="@title">
|
||||
<xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user