Skip to content

Commit 424d3bc

Browse files
committed
fix fixed indent list item looking indented code
1 parent d40714e commit 424d3bc

6 files changed

Lines changed: 44 additions & 26 deletions

File tree

.idea/markdown-navigator.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown-navigator/Wiki.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VERSION-TODO.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [Release 0.60.0](#release-0600)
88
- [API Refactoring](#api-refactoring)
99
- [Next 0.61.xx](#next-061xx)
10+
- [0.61.30](#06130)
1011
- [0.61.28](#06128)
1112
- [0.61.26](#06126)
1213
- [0.61.24](#06124)
@@ -226,6 +227,10 @@ Please give feedback on the upcoming changes if you have concerns about breaking
226227
* [ ] Fix: Html converter to not add spaces between end of inline marker and next punctuation:
227228
`.,:;`
228229

230+
## 0.61.30
231+
232+
* Fix: [#402, When using PegdownOptionsAdapter indented code blocks does not work for lists]
233+
229234
## 0.61.28
230235

231236
* Fix: Toc and SimToc `levels` parsing to properly handle levels as per documentation.
@@ -2526,4 +2531,6 @@ Please give feedback on the upcoming changes if you have concerns about breaking
25262531
[migrate flexmark-java 0_40_x to 0_42_0]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_40_x%20to%200_42_0.xml
25272532
<!-- @IGNORE PREVIOUS: link -->
25282533
[migrate flexmark-java 0_42_x to 0_50_0.xml]: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml
2534+
[#402, When using PegdownOptionsAdapter indented code blocks does not work for lists]: https://github.com/vsch/flexmark-java/issues/402
2535+
25292536

flexmark-core-test/src/test/resources/core_pegdown_compatibility_spec.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ Issue #108, problem of the list of some Space in front, misunderstanding of
29822982
`Parser.LISTS_ITEM_INDENT` setting to 2
29832983

29842984
```````````````````````````````` example(Issues - 108: 1) options(lists-item-indent)
2985-
1. **download**
2985+
1. **download**
29862986
2. **abc** →→
29872987
3. **999**
29882988
@@ -2996,21 +2996,21 @@ Issue #108, problem of the list of some Space in front, misunderstanding of
29962996
</li>
29972997
</ol>
29982998
.
2999-
Document[0, 51]
3000-
OrderedList[2, 50] isTight delimiter:'.'
3001-
OrderedListItem[2, 50] open:[2, 4, "1."] isTight
3002-
Paragraph[5, 20]
3003-
StrongEmphasis[5, 17] textOpen:[5, 7, "**"] text:[7, 15, "download"] textClose:[15, 17, "**"]
3004-
Text[7, 15] chars:[7, 15, "download"]
3005-
OrderedList[22, 50] isTight start:2 delimiter:'.'
3006-
OrderedListItem[22, 37] open:[22, 24, "2."] isTight
3007-
Paragraph[25, 37]
3008-
StrongEmphasis[25, 32] textOpen:[25, 27, "**"] text:[27, 30, "abc"] textClose:[30, 32, "**"]
3009-
Text[27, 30] chars:[27, 30, "abc"]
3010-
OrderedListItem[39, 50] open:[39, 41, "3."] isTight hadBlankLineAfter
3011-
Paragraph[42, 50] isTrailingBlankLine
3012-
StrongEmphasis[42, 49] textOpen:[42, 44, "**"] text:[44, 47, "999"] textClose:[47, 49, "**"]
3013-
Text[44, 47] chars:[44, 47, "999"]
2999+
Document[0, 49]
3000+
OrderedList[0, 48] isTight delimiter:'.'
3001+
OrderedListItem[0, 48] open:[0, 2, "1."] isTight
3002+
Paragraph[3, 18]
3003+
StrongEmphasis[3, 15] textOpen:[3, 5, "**"] text:[5, 13, "download"] textClose:[13, 15, "**"]
3004+
Text[5, 13] chars:[5, 13, "download"]
3005+
OrderedList[20, 48] isTight start:2 delimiter:'.'
3006+
OrderedListItem[20, 35] open:[20, 22, "2."] isTight
3007+
Paragraph[23, 35]
3008+
StrongEmphasis[23, 30] textOpen:[23, 25, "**"] text:[25, 28, "abc"] textClose:[28, 30, "**"]
3009+
Text[25, 28] chars:[25, 28, "abc"]
3010+
OrderedListItem[37, 48] open:[37, 39, "3."] isTight hadBlankLineAfter
3011+
Paragraph[40, 48] isTrailingBlankLine
3012+
StrongEmphasis[40, 47] textOpen:[40, 42, "**"] text:[42, 45, "999"] textClose:[45, 47, "**"]
3013+
Text[42, 45] chars:[42, 45, "999"]
30143014
````````````````````````````````
30153015

30163016

@@ -3299,5 +3299,18 @@ Document[0, 40]
32993299
````````````````````````````````
33003300

33013301

3302-
[#382, Is there an option for number of whitespaces needed to create sub-lists?]: https://github.com/vsch/flexmark-java/issues/382
3302+
## Issue 402
3303+
3304+
Indented code block looking like list item
3305+
3306+
```````````````````````````````` example Issue 402: 1
3307+
- this is indented code
3308+
.
3309+
<pre><code>- this is indented code
3310+
</code></pre>
3311+
.
3312+
Document[0, 27]
3313+
IndentedCodeBlock[4, 27]
3314+
````````````````````````````````
3315+
33033316

flexmark-profile-pegdown/src/test/resources/pegdown_extension_compatibility_spec.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,9 +3454,8 @@ pegdown converts second item to lazy continuation because it is indented by more
34543454
.
34553455
<ul>
34563456
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" readonly="readonly" />&nbsp;First item
3457-
<ul>
3458-
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" readonly="readonly" />&nbsp;Second item</li>
3459-
</ul>
3457+
<pre><code>* [ ] Second item
3458+
</code></pre>
34603459
</li>
34613460
</ul>
34623461
````````````````````````````````
@@ -3470,9 +3469,8 @@ pegdown converts second item to lazy continuation because it is indented by more
34703469
.
34713470
<ul>
34723471
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" readonly="readonly" />&nbsp;First item
3473-
<ul>
3474-
<li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" readonly="readonly" />&nbsp;Second item</li>
3475-
</ul>
3472+
<pre><code> * [ ] Second item
3473+
</code></pre>
34763474
</li>
34773475
</ul>
34783476
````````````````````````````````

flexmark/src/main/java/com/vladsch/flexmark/parser/core/ListBlockParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockPar
563563
}
564564
} else if (emulationFamily == FIXED_INDENT) {
565565
int currentIndent = state.getIndent();
566-
if (currentIndent >= myOptions.getCodeIndent()) {
566+
if (currentIndent >= myOptions.getItemIndent()) {
567567
return BlockStart.none();
568568
}
569569
} else if (emulationFamily == KRAMDOWN) {

0 commit comments

Comments
 (0)