fix: Index of numbered lists are off

pull/1652/head
Krille 4 days ago
parent 221c3ef6bd
commit 20220d21fd
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -228,7 +228,7 @@ class HtmlMessage extends StatelessWidget {
if (node.parent?.localName == 'ol')
TextSpan(
text:
'${(node.parent?.nodes.indexOf(node) ?? 0) + (int.tryParse(node.parent?.attributes['start'] ?? '1') ?? 1)}. ',
'${(node.parent?.nodes.whereType<dom.Element>().toList().indexOf(node) ?? 0) + (int.tryParse(node.parent?.attributes['start'] ?? '1') ?? 1)}. ',
),
..._renderWithLineBreaks(
node.nodes,

Loading…
Cancel
Save