Skip to content
Closed
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
9 changes: 9 additions & 0 deletions lib/src/processing/lists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ class ListProcessing {
// Add the counters for the current scope.
tree.counters.addAll(counters?.deepCopy() ?? []);

// Check if the current node is an <ol> element and has a start attribute.
if (tree.name == 'ol' &&
tree.element?.attributes.containsKey('start') == true) {
final startValue =
int.tryParse(tree.element?.attributes['start'] ?? '1') ?? 1;
tree.style.counterReset ??= {};
tree.style.counterReset!['list-item'] = startValue - 1;
}

// Create any new counters
if (tree.style.counterReset != null) {
tree.style.counterReset!.forEach((counterName, initialValue) {
Expand Down