Remove empty header validation to allow empty header

This commit is contained in:
Bruno Miguens
2021-02-08 20:50:15 +00:00
parent a152c5b706
commit 8c28ade348
2 changed files with 26 additions and 2 deletions

View File

@@ -67,6 +67,30 @@ table_head_body = re.sub(r'\s+', '', """
</table>
""")
table_missing_header = re.sub(r'\s+', '', """
<table>
<thead>
<tr>
<th></th>
<th>Lastname</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</tbody>
</table>
""")
def test_chomp():
assert md(' <b></b> ') == ' '
@@ -267,3 +291,4 @@ def test_div():
def test_table():
assert md(table) == 'Firstname | Lastname | Age\n--- | --- | ---\nJill | Smith | 50\nEve | Jackson | 94'
assert md(table_head_body) == 'Firstname | Lastname | Age\n--- | --- | ---\nJill | Smith | 50\nEve | Jackson | 94'
assert md(table_missing_header) == ' | Lastname | Age\n--- | --- | ---\nJill | Smith | 50\nEve | Jackson | 94'