Skip to content

Commit

Permalink
tweak space in supplementary-materials-label (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-atherden authored Jan 23, 2025
1 parent 013839e commit 8eb1b28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/supplementary-materials-label.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
<xsl:apply-templates select="*[not(name()=('label','caption'))]|caption/following-sibling::text()|comment()|processing-instruction()"/>
</xsl:copy>
</xsl:template>


<!-- Add a space at the start of paras that follow a title or another para -->
<xsl:template match="supplementary-material/caption/p[preceding-sibling::title or preceding-sibling::p]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="text()|*|comment()|processing-instruction()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
2 changes: 1 addition & 1 deletion test/all/kitchen-sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ return :shrug:
<supplementary-material>
<label>Supp file 3</label>
<caption><title><bold>Supp file 3. </bold>This is a title</title>
<p>This is a para.</p>
<p> This is a para.</p>
</caption>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
Expand Down
2 changes: 1 addition & 1 deletion test/supplementary-materials-label/kitchen-sink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ return :shrug:
<supplementary-material>
<label>Supp file 3</label>
<caption><title><bold>Supp file 3. </bold>This is a title</title>
<p>This is a para.</p>
<p> This is a para.</p>
</caption>
<media xlink:href="supplements/468444_file03.pdf"/>
</supplementary-material>
Expand Down

0 comments on commit 8eb1b28

Please sign in to comment.