Skip to content

Commit

Permalink
fix(#35): closing inlined tags when closing paragraph for pagenums in…
Browse files Browse the repository at this point in the history
…sertion

Also did a small cleanup by removing previous commented commands
  • Loading branch information
NPavie committed Jan 9, 2024
1 parent 72c3b48 commit ed8173c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Common/DaisyConverterLib/resources/xslts/Common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,6 @@
<xsl:choose>
<!--check if <p> teg was opened in "Languages" template-->
<xsl:when test="(w:r/w:rPr/w:lang) or (w:r/w:rPr/w:rFonts/@w:hint)">
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1131,7 +1130,6 @@
</xsl:when>
<xsl:otherwise>
<xsl:if test="(not(w:r/w:rPr/w:rStyle[@w:val='PageNumberDAISY']) and ($custom='Custom')) or (not($custom='Custom'))">
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand Down Expand Up @@ -1289,7 +1287,6 @@
<xsl:if test="not(../preceding-sibling::node()[1]/w:pPr/w:sectPr)">
<xsl:variable name="increment" select="myObj:IncrementPage()"/>
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1315,7 +1312,6 @@
</prodnote>
<xsl:if test="$flag='3'">
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1340,7 +1336,6 @@
<!--Incrementing page numbers-->
<xsl:variable name="increment" select="myObj:IncrementPage()"/>
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1361,7 +1356,6 @@
</xsl:call-template>
<xsl:if test="$flag='3'">
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1380,7 +1374,6 @@
or ../w:pPr/w:pStyle[substring(@w:val,1,5)='Index'])">
<xsl:variable name="increment" select="myObj:IncrementPage()"/>
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand All @@ -1401,7 +1394,6 @@
</xsl:call-template>
<xsl:if test="$flag='3'">
<!--Closing paragraph tag-->
<!--<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>-->
<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
<xsl:with-param name="verfoot" select="$VERSION"/>
Expand Down Expand Up @@ -2111,6 +2103,8 @@
</line>
</xsl:when>
<xsl:when test="(myObj:Getlinenumflag()='1')">
<!-- NP 20240109 : close all inlines before closing paragraph -->
<xsl:call-template name="CloseAllStyleTag"/>
<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>
<line>
<linenum>
Expand Down
4 changes: 4 additions & 0 deletions Common/DaisyConverterLib/resources/xslts/Common2.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ xmlns:v="urn:schemas-microsoft-com:vml"
<!-- NP 20220503 : using CloseLevel to also close paragraph -->
<xsl:when test="$CurrentLevel = -1">
<xsl:message terminate="no">debug:Closing paragraph</xsl:message>
<!-- NP 20240109 : close all inlines before closing paragraph -->
<xsl:call-template name="CloseAllStyleTag"/>
<!--Close that level-->
<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>
<!-- insert footnotes after the paragraph if inlined footnotes in the current level is requested
Expand Down Expand Up @@ -958,6 +960,8 @@ xmlns:v="urn:schemas-microsoft-com:vml"
</xsl:if>
<xsl:variable name="captionflag" select="myObj:reSetcaptionFlag()"/>
<xsl:if test="(preceding-sibling::w:p[1]/w:r/w:rPr/w:rtl) or (preceding-sibling::w:p[1]/w:pPr/w:bidi)">
<!-- NP 20240109 : close all inlines before closing paragraph -->
<xsl:call-template name="CloseAllStyleTag"/>
<xsl:value-of disable-output-escaping="yes" select="concat('&lt;','/p','&gt;')"/>
<!--<xsl:call-template name="CloseLevel">
<xsl:with-param name="CurrentLevel" select="-1"/>
Expand Down

0 comments on commit ed8173c

Please sign in to comment.