Skip to content

Commit

Permalink
Add space before td end tag
Browse files Browse the repository at this point in the history
Signed-off-by: Jarno Elovirta <[email protected]>
  • Loading branch information
jelovirt committed Dec 24, 2023
1 parent 87942a6 commit 664140a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
48 changes: 32 additions & 16 deletions src/main/resources/ast2markdown.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,23 @@
<xsl:copy-of select="@*"/>
<xsl:value-of select="$linefeed"/>
<xsl:value-of select="$linefeed"/>
<xsl:variable name="contents" as="xs:string*">
<xsl:apply-templates mode="#current">
<xsl:with-param name="indent" tunnel="yes" select="''"/>
</xsl:apply-templates>
<xsl:variable name="contents" as="xs:string">
<xsl:value-of separator="">
<xsl:apply-templates mode="#current">
<xsl:with-param name="indent" tunnel="yes" select="''"/>
</xsl:apply-templates>
</xsl:value-of>
</xsl:variable>
<xsl:value-of select="$contents" separator=""/>
<xsl:if test="empty($contents[last()][ends-with(., '&#xA;')])">
<xsl:value-of select="$linefeed"/>
</xsl:if>
<xsl:value-of select="$contents" separator="|"/>
<xsl:choose>
<xsl:when test="not(ends-with($contents, '&#xA;&#xA;'))">
<xsl:value-of select="$linefeed"/>
<xsl:value-of select="$linefeed"/>
</xsl:when>
<xsl:when test="not(ends-with($contents, '&#xA;'))">
<xsl:value-of select="$linefeed"/>
</xsl:when>
</xsl:choose>
</th>
</xsl:for-each>
</tr>
Expand All @@ -281,15 +289,23 @@
<xsl:copy-of select="@*"/>
<xsl:value-of select="$linefeed"/>
<xsl:value-of select="$linefeed"/>
<xsl:variable name="contents" as="xs:string*">
<xsl:apply-templates mode="#current">
<xsl:with-param name="indent" tunnel="yes" select="''"/>
</xsl:apply-templates>
<xsl:variable name="contents" as="xs:string">
<xsl:value-of separator="">
<xsl:apply-templates mode="#current">
<xsl:with-param name="indent" tunnel="yes" select="''"/>
</xsl:apply-templates>
</xsl:value-of>
</xsl:variable>
<xsl:value-of select="$contents" separator=""/>
<xsl:if test="empty($contents[last()][ends-with(., '&#xA;')])">
<xsl:value-of select="$linefeed"/>
</xsl:if>
<xsl:value-of select="$contents" separator="|"/>
<xsl:choose>
<xsl:when test="not(ends-with($contents, '&#xA;&#xA;'))">
<xsl:value-of select="$linefeed"/>
<xsl:value-of select="$linefeed"/>
</xsl:when>
<xsl:when test="not(ends-with($contents, '&#xA;'))">
<xsl:value-of select="$linefeed"/>
</xsl:when>
</xsl:choose>
</td>
</xsl:for-each>
</tr>
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/output/markdown/table-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
<table><thead><tr><th>

A

</th><th>

B

</th><th>

C

</th></tr></thead><tbody><tr><td>

A1 **bold**
Expand Down

0 comments on commit 664140a

Please sign in to comment.