chore: Add start to ordered list

This commit is contained in:
Krille 2025-02-03 12:28:57 +01:00
parent 2869d341a6
commit 6cdfced81f
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -137,8 +137,11 @@ class HtmlMessage extends StatelessWidget {
text = '$text';
}
if (node.parent?.parent?.localName == 'ol') {
final start =
int.tryParse(node.parent?.parent?.attributes['start'] ?? '1') ??
1;
text =
'${(node.parent?.parent?.nodes.indexOf(node.parent) ?? 0) + 1}. $text';
'${(node.parent?.parent?.nodes.indexOf(node.parent) ?? 0) + start}. $text';
}
if (node.parent?.parent?.parent?.localName == 'li') {
text = ' $text';