Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: newline with 1~4 spaces below table
  • Loading branch information
cyanxiao committed Dec 11, 2021
commit 8cf79cda9d9623f08b4d338b6cc83caa44d6bdd4
4 changes: 4 additions & 0 deletions src/Tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ export class Tokenizer {

l = item.rows.length;
for (i = 0; i < l; i++) {
if (/^\s{1,4}$/.test(item.rows[i])) {
item.rows.pop();
continue;
}
item.rows[i] = splitCells(item.rows[i], item.header.length).map(c => { return { text: c }; });
}

Expand Down
12 changes: 12 additions & 0 deletions test/specs/new/tab_newline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<table>
<thead>
<tr>
<th>y</th>
</tr>
</thead>
<tbody>
<tr>
<td>x</td>
</tr>
</tbody>
</table>
4 changes: 4 additions & 0 deletions test/specs/new/tab_newline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| y |
| - |
| x |