Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ with the exception that 0.x versions can break between minor versions.
### Fixed
- `MarkdownRenderer`: Fix precedence for `nodeRendererFactory`: Factories passed
to the builder can now override rendering for core node types.
- `MarkdownRenderer`: Fix exception with ordered lists with a long first number
followed by a shorter one (#382)
- Fix warning in Eclipse about "missing 'requires transitive'"
- Fix Android incompatibility with `requireNonNullElseGet`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void visit(ListItem listItem) {
throw new IllegalStateException("Unknown list holder type: " + listHolder);
}
Integer contentIndent = listItem.getContentIndent();
String spaces = contentIndent != null ? repeat(" ", contentIndent - marker.length()) : " ";
String spaces = contentIndent != null ? repeat(" ", Math.max(contentIndent - marker.length(), 1)) : " ";
writer.writePrefix(marker);
writer.writePrefix(spaces);
writer.pushPrefix(repeat(" ", marker.length() + spaces.length()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ public void testOrderedListItemsFromAst() {
assertRendering("", "2) Test\n", render(doc));
}

@Test
public void testOrderedListItemsWithStartNumberLongerThanLaterNumber() {
var source = "10001.\n20.\n";
var doc = parse(source);
assertRendering(source, "10001. \n10002. \n", render(doc));
}

// Inlines

@Test
Expand Down
Loading