aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIsaac Muse <faceless.shop@gmail.com>2017-01-26 11:25:06 -0700
committerWaylan Limberg <waylan.limberg@icloud.com>2017-01-26 13:25:06 -0500
commitab9f4c2dfb678c773387fe478f24bb59a0908e27 (patch)
treef549bc3b95388ef69b75d1a58d18bce7013ac1b6 /tests
parent13c88972de9976137e9f523a80bfd71cdfb97224 (diff)
downloadmarkdown-ab9f4c2dfb678c773387fe478f24bb59a0908e27.tar.gz
markdown-ab9f4c2dfb678c773387fe478f24bb59a0908e27.tar.bz2
markdown-ab9f4c2dfb678c773387fe478f24bb59a0908e27.zip
Fix regression of single column tables (#540)
Single column tables are valid tables, so add back in the accidentally removed functionality of allowing single column tables, but with one exception -- table bodies should not render empty (an empty `<tbody>` is invalid HTML. Fixes #539.
Diffstat (limited to 'tests')
-rw-r--r--tests/extensions/extra/tables.html92
-rw-r--r--tests/extensions/extra/tables.txt39
2 files changed, 129 insertions, 2 deletions
diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html
index 2418c98..25dee48 100644
--- a/tests/extensions/extra/tables.html
+++ b/tests/extensions/extra/tables.html
@@ -167,7 +167,12 @@ Content Cell | Content Cell
<th>Second Header</th>
</tr>
</thead>
-<tbody></tbody>
+<tbody>
+<tr>
+<td></td>
+<td></td>
+</tr>
+</tbody>
</table>
<p>More inline code block tests</p>
<table>
@@ -375,4 +380,87 @@ Content Cell | Content Cell
<td>\\<code>code</code></td>
</tr>
</tbody>
-</table> \ No newline at end of file
+</table>
+<p>Single column tables</p>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td></td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Is a Table</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>row</td>
+</tr>
+</tbody>
+</table>
+<h2>| Is not a Table</h2>
+<p>| row</p>
+<h2>Is not a Table |</h2>
+<p>row |</p>
+<p>| Is not a Table
+| --------------
+row</p>
+<p>Is not a Table |
+-------------- |
+row</p> \ No newline at end of file
diff --git a/tests/extensions/extra/tables.txt b/tests/extensions/extra/tables.txt
index d766224..2dc4967 100644
--- a/tests/extensions/extra/tables.txt
+++ b/tests/extensions/extra/tables.txt
@@ -128,3 +128,42 @@ Should not be code | Should be code
------------------ | --------------
\`Not code\` | \\`code`
\\\`Not code\\\` | \\\\`code`
+
+Single column tables
+
+| Is a Table |
+| ---------- |
+
+| Is a Table
+| ----------
+
+Is a Table |
+---------- |
+
+| Is a Table |
+| ---------- |
+| row |
+
+| Is a Table
+| ----------
+| row
+
+Is a Table |
+---------- |
+row |
+
+| Is not a Table
+--------------
+| row
+
+Is not a Table |
+--------------
+row |
+
+| Is not a Table
+| --------------
+row
+
+Is not a Table |
+-------------- |
+row