Skip to content

Commit

Permalink
Fix tables inside lists indented with tabs
Browse files Browse the repository at this point in the history
close #721
  • Loading branch information
rlidwka committed Oct 19, 2020
1 parent f156ed1 commit 67e7239
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules_block/table.js
Expand Up @@ -6,7 +6,7 @@ var isSpace = require('../common/utils').isSpace;


function getLine(state, line) {
var pos = state.bMarks[line] + state.blkIndent,
var pos = state.bMarks[line] + state.tShift[line],
max = state.eMarks[line];

return state.src.substr(pos, max - pos);
Expand Down
36 changes: 36 additions & 0 deletions test/fixtures/markdown-it/tables.txt
Expand Up @@ -568,6 +568,42 @@ Escape before escaped Pipes inside backticks don't split cells:
</table>
.

Regression test for #721, table in a list indented with tabs:
.
- Level 1

- Level 2

| Column 1 | Column 2 |
| -------- | -------- |
| abcdefgh | ijklmnop |
.
<ul>
<li>
<p>Level 1</p>
<ul>
<li>
<p>Level 2</p>
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>abcdefgh</td>
<td>ijklmnop</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
.

GFM 4.10 Tables (extension), Example 198
.
| foo | bar |
Expand Down

0 comments on commit 67e7239

Please sign in to comment.