fix: account for nontokens in ordered list rendering (#5645)

* fix: account for nontokens in ordered list rendering

* remove pangea comments
This commit is contained in:
ggurdin 2026-02-10 14:43:25 -05:00 committed by GitHub
parent 9abb6ed6fc
commit ebc7dd2c2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -352,10 +352,8 @@ class HtmlMessage extends StatelessWidget {
if (nodes[i] is dom.Element &&
onlyElements.indexOf(nodes[i] as dom.Element) <
onlyElements.length - 1) ...[
// #Pangea
// if (blockHtmlTags.contains((nodes[i] as dom.Element).localName))
// const TextSpan(text: '\n\n'),
// Pangea#
if (blockHtmlTags.contains((nodes[i] as dom.Element).localName))
const TextSpan(text: '\n\n'),
if (fullLineHtmlTag.contains((nodes[i] as dom.Element).localName))
const TextSpan(text: '\n'),
],
@ -695,9 +693,11 @@ class HtmlMessage extends StatelessWidget {
// Pangea#
if (node.parent?.localName == 'ol')
TextSpan(
text:
'${(node.parent?.nodes.whereType<dom.Element>().toList().indexOf(node) ?? 0) + (int.tryParse(node.parent?.attributes['start'] ?? '1') ?? 1)}. ',
// #Pangea
// text:
// '${(node.parent?.nodes.whereType<dom.Element>().toList().indexOf(node) ?? 0) + (int.tryParse(node.parent?.attributes['start'] ?? '1') ?? 1)}. ',
text:
'${(node.parent?.nodes.whereType<dom.Element>().where((e) => e.localName != 'nontoken').toList().indexOf(node) ?? 0) + (int.tryParse(node.parent?.attributes['start'] ?? '1') ?? 1)}. ',
style: existingStyle,
// Pangea#
),