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 08ee3a7 commit 75fe6e0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [12.0.1] - WIP
### Fixed
- Fix tables inside lists indented with tabs, #721.


## [12.0.0] - 2020-10-14
### Added
- `.gitattributes`, force unix eol under windows, for development.
Expand Down Expand Up @@ -524,6 +529,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed presets folder (configs -> presets).


[12.0.1]: https://github.com/markdown-it/markdown-it/compare/12.0.0...12.0.1
[12.0.0]: https://github.com/markdown-it/markdown-it/compare/11.0.1...12.0.0
[11.0.1]: https://github.com/markdown-it/markdown-it/compare/11.0.0...11.0.1
[11.0.0]: https://github.com/markdown-it/markdown-it/compare/10.0.0...11.0.0
Expand Down
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 75fe6e0

Please sign in to comment.