From 1cd8a5143b22967a7583bba19678900efdf72adf Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 7 Jan 2022 17:51:28 +0300 Subject: [PATCH] Fix tab preventing paragraph continuation in lists close https://github.com/markdown-it/markdown-it/issues/830 --- CHANGELOG.md | 6 ++++++ lib/rules_block/list.js | 2 +- .../markdown-it/commonmark_extras.txt | 21 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 103f69246..73c23b9f3 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.3.1] - WIP +### Fixed +- Fix corner case when tab prevents paragraph continuation in lists, #830. + + ## [12.3.0] - 2021-12-09 ### Changed - `StateInline.delimiters[].jump` is removed. @@ -583,6 +588,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Renamed presets folder (configs -> presets). +[12.3.1]: https://github.com/markdown-it/markdown-it/compare/12.3.0...12.3.1 [12.3.0]: https://github.com/markdown-it/markdown-it/compare/12.2.0...12.3.0 [12.2.0]: https://github.com/markdown-it/markdown-it/compare/12.1.0...12.2.0 [12.1.0]: https://github.com/markdown-it/markdown-it/compare/12.0.6...12.1.0 diff --git a/lib/rules_block/list.js b/lib/rules_block/list.js index 6b164d517..1e5e87b27 100644 --- a/lib/rules_block/list.js +++ b/lib/rules_block/list.js @@ -152,7 +152,7 @@ module.exports = function list(state, startLine, endLine, silent) { // This code can fail if plugins use blkIndent as well as lists, // but I hope the spec gets fixed long before that happens. // - if (state.tShift[startLine] >= state.blkIndent) { + if (state.sCount[startLine] >= state.blkIndent) { isTerminatingParagraph = true; } } diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index d884b0589..37d361882 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -166,6 +166,27 @@ Regression test (code block + regular paragraph) . +Regression test (tabs in lists, #830) +. +1. asd + 2. asd + +--- + +1. asd + 2. asd +. +
    +
  1. asd +2. asd
  2. +
+
+
    +
  1. asd +2. asd
  2. +
+. + Blockquotes inside indented lists should terminate correctly . - a