We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79ec194 commit 310d94bCopy full SHA for 310d94b
lib/src/processing/lists.dart
@@ -38,6 +38,16 @@ class ListProcessing {
38
39
// Add the counters to ol and ul types.
40
if (tree.name == 'ol' || tree.name == 'ul') {
41
+ // respect the `start` attribute in order to begin lists at !1.
42
+ final startAttribute = tree.attributes['start'];
43
+ final offset =
44
+ startAttribute == null ? 1 : int.tryParse(startAttribute) ?? 1;
45
+
46
+ tree.style.counterIncrement ??= {};
47
+ // the counter starts at 1 so set to 0 in order to be correct after first
48
+ // increment
49
+ tree.style.counterIncrement!['list-item'] = offset - 1;
50
51
tree.style.counterReset ??= {};
52
if (!tree.style.counterReset!.containsKey('list-item')) {
53
tree.style.counterReset!['list-item'] = 0;
0 commit comments