diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b68ee49b..1a7eb25d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -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 diff --git a/lib/rules_block/table.js b/lib/rules_block/table.js index 4b1774270..89ed65c93 100644 --- a/lib/rules_block/table.js +++ b/lib/rules_block/table.js @@ -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; } diff --git a/test/fixtures/markdown-it/tables.txt b/test/fixtures/markdown-it/tables.txt index c8e0d7805..cd71b8d96 100644 --- a/test/fixtures/markdown-it/tables.txt +++ b/test/fixtures/markdown-it/tables.txt @@ -604,6 +604,19 @@ Regression test for #721, table in a list indented with tabs: . + +Table without any columns is not a table, #724 +. +| +| +| +. +

| +| +|

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