Skip to content

Commit

Permalink
chore: Add start to ordered list
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Feb 3, 2025
1 parent 2869d34 commit 6cdfced
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/pages/chat/events/html_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 6cdfced

Please sign in to comment.