legi2odf: fix handling of captions (#6132)
This commit is contained in:
parent
b1e8335e09
commit
cbeb691a41
|
@ -336,7 +336,32 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="mediaobject" mode="inline">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="caption">
|
||||
<draw:frame>
|
||||
<xsl:attribute name="svg:width">
|
||||
<xsl:value-of select="imageobject/imagedata/@width"/>
|
||||
</xsl:attribute>
|
||||
<draw:text-box>
|
||||
<xsl:attribute name="fo:min-height">
|
||||
<xsl:value-of select="imageobject/imagedata/@depth"/>
|
||||
</xsl:attribute>
|
||||
<text:p>
|
||||
<xsl:apply-templates/>
|
||||
Illustration
|
||||
<text:sequence text:name="Illustration" text:formula="ooow:Illustration+1" style:num-format="1">
|
||||
<xsl:attribute name="text:ref-name">
|
||||
<xsl:value-of select="caption/@id"/>
|
||||
</xsl:attribute> X </text:sequence>: <xsl:value-of select="caption"/>
|
||||
</text:p>
|
||||
</draw:text-box>
|
||||
</draw:frame>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="imageobject">
|
||||
|
|
|
@ -1073,6 +1073,7 @@ def convert_to_legi_xml(content, metadata = None):
|
|||
# authorized but people got used to do that for prefaces
|
||||
if len(current_top[0].getchildren()) == 1 and offstructure is None:
|
||||
offstructure = ET.SubElement(current_top[-1], 'nosection')
|
||||
handle_elem(offstructure, elem)
|
||||
elif len(current_top[0].getchildren()) == 2 and offstructure is not None:
|
||||
handle_elem(offstructure, elem)
|
||||
if len(offstructure.getchildren()) > 0 and \
|
||||
|
|
Reference in New Issue