Skip to content

Commit

Permalink
Table with no columns is no longer a table
Browse files Browse the repository at this point in the history
this is now just raw text:

```md
|
|
|
```

close #724
  • Loading branch information
rlidwka committed Oct 23, 2020
1 parent e3c4c5c commit b56eeb0
Show file tree
Hide file tree
Showing 3 changed files with 20 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.2] - WIP
### Fixed
- Three pipes (`|\n|\n|`) are no longer rendered as a table with no columns, #724.


## [12.0.1] - 2020-10-19
### Fixed
- Fix tables inside lists indented with tabs, #721.
Expand Down Expand Up @@ -529,6 +534,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed presets folder (configs -> presets).


[12.0.2]: https://github.com/markdown-it/markdown-it/compare/12.0.1...12.0.2
[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
Expand Down
2 changes: 1 addition & 1 deletion lib/rules_block/table.js
Expand Up @@ -118,7 +118,7 @@ module.exports = function table(state, startLine, endLine, silent) {
// header row will define an amount of columns in the entire table,
// and align row should be exactly the same (the rest of the rows can differ)
columnCount = columns.length;
if (columnCount !== aligns.length) { return false; }
if (columnCount === 0 || columnCount !== aligns.length) { return false; }

if (silent) { return true; }

Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/markdown-it/tables.txt
Expand Up @@ -604,6 +604,19 @@ Regression test for #721, table in a list indented with tabs:
</ul>
.


Table without any columns is not a table, #724
.
|
|
|
.
<p>|
|
|</p>
.


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

0 comments on commit b56eeb0

Please sign in to comment.