guard table lines with pipes, resolves the empty header problem

This commit is contained in:
AlexVonB
2021-04-22 12:36:11 +02:00
parent de6f91af0e
commit e1dbbfad42
2 changed files with 7 additions and 8 deletions

View File

@@ -71,7 +71,7 @@ table_missing_text = re.sub(r'\s+', '', """
<table>
<thead>
<tr>
<th>Firstname</th>
<th></th>
<th>Lastname</th>
<th>Age</th>
</tr>
@@ -289,6 +289,6 @@ 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_text) == 'Firstname | Lastname | Age\n--- | --- | ---\nJill | | 50\nEve | Jackson | 94'
assert md(table) == '| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |'
assert md(table_head_body) == '| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |'
assert md(table_missing_text) == '| | Lastname | Age |\n| --- | --- | --- |\n| Jill | | 50 |\n| Eve | Jackson | 94 |'