Skip to content

Commit

Permalink
callouts with classes are now rendered correctly, according to https:…
Browse files Browse the repository at this point in the history
  • Loading branch information
Basster committed Sep 18, 2018
1 parent a182f26 commit 84a24a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
14 changes: 2 additions & 12 deletions src/inky.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,10 @@
</xsl:template>

<xsl:template match="//callout">
<table class="">
<table class="callout">
<xsl:copy-of select="@*[name()!='class']"/>
<tr>
<th class="callout-inner"><xsl:apply-templates /></th>
<th class="expander"></th>
</tr>
</table>
</xsl:template>

<xsl:template match="//callout">
<table class="{normalize-space(concat(@class, ' callout'))}">
<xsl:copy-of select="@*[name()!='class']"/>
<tr>
<th class="callout-inner"><xsl:apply-templates /></th>
<th class="{normalize-space(concat('callout-inner ', @class))}"><xsl:apply-templates /></th>
<th class="expander"></th>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions tests/ComponentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ public function testCreateCalloutWithClasses()
<callout class="primary">Callout</callout>
doc;
$expected =<<<doc
<table class="primary callout">
<table class="callout">
<tr>
<th class="callout-inner">Callout</th>
<th class="callout-inner primary">Callout</th>
<th class="expander"></th>
</tr>
</table>
Expand Down

0 comments on commit 84a24a3

Please sign in to comment.