fix: fix blank line after table header (#2332)

This commit is contained in:
Tony Brix 2022-01-26 15:51:00 -06:00 committed by GitHub
parent 5384d17d71
commit 6e1f9235dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -369,7 +369,7 @@ export class Tokenizer {
type: 'table',
header: splitCells(cap[1]).map(c => { return { text: c }; }),
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
rows: cap[3] ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
};
if (item.header.length === item.align.length) {

View File

@ -36,3 +36,10 @@
</table>
<pre><code>code
</code></pre>
<table>
<thead>
<tr>
<th>y</th>
</tr>
</thead>
</table>

View File

@ -9,4 +9,7 @@
| y |
| - |
| x |
code
code
| y |
| - |