Skip to content

Commit

Permalink
move figures out of p elements
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Apr 23, 2024
1 parent 1f07868 commit c51c85a
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions xsl/common_main.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -841,19 +841,50 @@
<xsl:text>inlineEnd</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:for-each-group select="node()" group-ending-with="tei:list|tei:specList|teix:egXML|tei:eg">
<xsl:if test="current-group()[not(self::tei:list or self::tei:specList or self::teix:egXML or self::tei:table or self::tei:floatingText or self::tei:eg)][matches(., '\S')] or current-group()[not(self::tei:list or self::tei:specList or self::teix:egXML or self::tei:table or self::tei:floatingText or self::tei:eg)][self::element()]">
<xsl:for-each-group select="node()" group-ending-with="tei:list|tei:specList|teix:egXML|tei:eg|tei:figure">
<xsl:if test="current-group()[
not(self::tei:list
or self::tei:specList
or self::teix:egXML
or self::tei:table
or self::tei:floatingText
or self::tei:eg
or self::tei:figure)]
[matches(., '\S')]
or current-group()[
not(self::tei:list
or self::tei:specList
or self::teix:egXML
or self::tei:table
or self::tei:floatingText
or self::tei:eg
or self::tei:figure)]
[self::element()]">
<xsl:element name="p">
<xsl:if test="position() eq 1">
<xsl:apply-templates select="parent::tei:p/@xml:id"/>
</xsl:if>
<xsl:if test="$inlineEnd">
<xsl:attribute name="class" select="$inlineEnd"/>
</xsl:if>
<xsl:apply-templates select="current-group()[not(self::tei:list or self::tei:specList or self::teix:egXML or self::tei:table or self::tei:floatingText or self::tei:eg)]"/>
<xsl:apply-templates select="current-group()[
not(self::tei:list
or self::tei:specList
or self::teix:egXML
or self::tei:table
or self::tei:floatingText
or self::tei:eg
or self::tei:figure)]"/>
</xsl:element>
</xsl:if>
<xsl:apply-templates select="current-group()[self::tei:list or self::tei:specList or self::teix:egXML or self::tei:table or self::tei:floatingText or self::tei:eg]"/>
<xsl:apply-templates select="current-group()[
self::tei:list
or self::tei:specList
or self::teix:egXML
or self::tei:table
or self::tei:floatingText
or self::tei:eg
or self::tei:figure]"/>
</xsl:for-each-group>
</xsl:template>

Expand Down

0 comments on commit c51c85a

Please sign in to comment.