Skip to content

Commit 1736dcf

Browse files
committed
Ordered list with proper counting.
1 parent 9586f1b commit 1736dcf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/lib/shared/changelog.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ class _MarkdownVisitor extends dom_parsing.TreeVisitor {
238238
final indent = ' ' * (_listDepth - 1);
239239
_write(indent);
240240
if (parent == 'ol') {
241-
_write('1. ');
241+
final childIndex = (node.parent?.children.indexOf(node) ?? 0) + 1;
242+
_write('$childIndex. ');
242243
} else {
243244
_write('- ');
244245
}

app/test/shared/changelog_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ And:
583583
'And:\n'
584584
'\n'
585585
'1. order\n'
586-
'1. list\n'
586+
'2. list\n'
587587
'\n'
588588
'> With multiline quoted `code`and *text*.\n'
589589
'\n'

0 commit comments

Comments
 (0)