Browse Source

Fix tab preventing paragraph continuation in lists

close https://github.com/markdown-it/markdown-it/issues/830
pull/843/head
Alex Kocharin 3 years ago
parent
commit
1cd8a5143b
  1. 6
      CHANGELOG.md
  2. 2
      lib/rules_block/list.js
  3. 21
      test/fixtures/markdown-it/commonmark_extras.txt

6
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). 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 ## [12.3.0] - 2021-12-09
### Changed ### Changed
- `StateInline.delimiters[].jump` is removed. - `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). - 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.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.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 [12.1.0]: https://github.com/markdown-it/markdown-it/compare/12.0.6...12.1.0

2
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, // This code can fail if plugins use blkIndent as well as lists,
// but I hope the spec gets fixed long before that happens. // 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; isTerminatingParagraph = true;
} }
} }

21
test/fixtures/markdown-it/commonmark_extras.txt

@ -166,6 +166,27 @@ Regression test (code block + regular paragraph)
</blockquote> </blockquote>
. .
Regression test (tabs in lists, #830)
.
1. asd
2. asd
---
1. asd
2. asd
.
<ol>
<li>asd
2. asd</li>
</ol>
<hr>
<ol>
<li>asd
2. asd</li>
</ol>
.
Blockquotes inside indented lists should terminate correctly Blockquotes inside indented lists should terminate correctly
. .
- a - a

Loading…
Cancel
Save