@@ -306,8 +306,8 @@ class ContentExample {
306
306
'<p><em>italic</em> <a href="https://zulip.com/">zulip</a></p>\n '
307
307
'</div></div>' ,
308
308
[SpoilerNode (
309
- header: [ListNode ( ListStyle .ordered, [
310
- [ListNode ( ListStyle .unordered, [
309
+ header: [OrderedListNode (items : [
310
+ [UnorderedListNode (items : [
311
311
[HeadingNode (level: HeadingLevel .h2, links: null , nodes: [
312
312
TextNode ('hello' ),
313
313
])]
@@ -763,7 +763,7 @@ class ContentExample {
763
763
'<div class="message_inline_image">'
764
764
'<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png">'
765
765
'<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div></li>\n </ul>' , [
766
- ListNode ( ListStyle .unordered, [[
766
+ UnorderedListNode (items : [[
767
767
ImageNodeList ([
768
768
ImageNode (srcUrl: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' ,
769
769
thumbnailUrl: null , loading: false ,
@@ -785,7 +785,7 @@ class ContentExample {
785
785
'<div class="message_inline_image">'
786
786
'<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2" title="icon.png">'
787
787
'<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2"></a></div></li>\n </ul>' , [
788
- ListNode ( ListStyle .unordered, [[
788
+ UnorderedListNode (items : [[
789
789
ParagraphNode (wasImplicit: true , links: null , nodes: [
790
790
LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
791
791
TextNode (' ' ),
@@ -814,7 +814,7 @@ class ContentExample {
814
814
'<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png" title="icon.png">'
815
815
'<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div>'
816
816
'more text</li>\n </ul>' , [
817
- ListNode ( ListStyle .unordered, [[
817
+ UnorderedListNode (items : [[
818
818
const ParagraphNode (wasImplicit: true , links: null , nodes: [
819
819
LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
820
820
TextNode (' ' ),
@@ -1382,7 +1382,7 @@ void main() {
1382
1382
testParse ('<ol>' ,
1383
1383
// "1. first\n2. then"
1384
1384
'<ol>\n <li>first</li>\n <li>then</li>\n </ol>' , const [
1385
- ListNode ( ListStyle .ordered, [
1385
+ OrderedListNode (items : [
1386
1386
[ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
1387
1387
[ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('then' )])],
1388
1388
]),
@@ -1391,7 +1391,7 @@ void main() {
1391
1391
testParse ('<ul>' ,
1392
1392
// "* something\n* another"
1393
1393
'<ul>\n <li>something</li>\n <li>another</li>\n </ul>' , const [
1394
- ListNode ( ListStyle .unordered, [
1394
+ UnorderedListNode (items : [
1395
1395
[ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('something' )])],
1396
1396
[ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('another' )])],
1397
1397
]),
@@ -1400,7 +1400,7 @@ void main() {
1400
1400
testParse ('implicit paragraph with internal <br>' ,
1401
1401
// "* a\n b"
1402
1402
'<ul>\n <li>a<br>\n b</li>\n </ul>' , const [
1403
- ListNode ( ListStyle .unordered, [
1403
+ UnorderedListNode (items : [
1404
1404
[ParagraphNode (wasImplicit: true , links: null , nodes: [
1405
1405
TextNode ('a' ),
1406
1406
LineBreakInlineNode (),
@@ -1412,13 +1412,43 @@ void main() {
1412
1412
testParse ('explicit paragraphs' ,
1413
1413
// "* a\n\n b"
1414
1414
'<ul>\n <li>\n <p>a</p>\n <p>b</p>\n </li>\n </ul>' , const [
1415
- ListNode ( ListStyle .unordered, [
1415
+ UnorderedListNode (items : [
1416
1416
[
1417
1417
ParagraphNode (links: null , nodes: [TextNode ('a' )]),
1418
1418
ParagraphNode (links: null , nodes: [TextNode ('b' )]),
1419
1419
],
1420
1420
]),
1421
1421
]);
1422
+
1423
+ testParse ('ordered list - large start number (9999)' ,
1424
+ // "9999. first\n10000. second"
1425
+ '<ol start="9999">\n <li>first</li>\n <li>second</li>\n </ol>' , const [
1426
+ OrderedListNode (
1427
+ start: 9999 ,
1428
+ items: [
1429
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
1430
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('second' )])],
1431
+ ]),
1432
+ ]);
1433
+
1434
+ testParse ('ordered list - default start (1)' ,
1435
+ '<ol>\n <li>first</li>\n <li>second</li>\n </ol>' , const [
1436
+ OrderedListNode (
1437
+ items: [
1438
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
1439
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('second' )])],
1440
+ ]),
1441
+ ]);
1442
+
1443
+ testParse ('ordered list - custom start (5)' ,
1444
+ '<ol start="5">\n <li>fifth</li>\n <li>sixth</li>\n </ol>' , const [
1445
+ OrderedListNode (
1446
+ start: 5 ,
1447
+ items: [
1448
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('fifth' )])],
1449
+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('sixth' )])],
1450
+ ]),
1451
+ ]);
1422
1452
});
1423
1453
1424
1454
testParseExample (ContentExample .spoilerDefaultHeader);
@@ -1451,7 +1481,7 @@ void main() {
1451
1481
testParse ('link in list item' ,
1452
1482
// "* [t](/u)"
1453
1483
'<ul>\n <li><a href="/u">t</a></li>\n </ul>' , const [
1454
- ListNode ( ListStyle .unordered, [
1484
+ UnorderedListNode (items : [
1455
1485
[ParagraphNode (links: null , wasImplicit: true , nodes: [
1456
1486
LinkNode (url: '/u' , nodes: [TextNode ('t' )]),
1457
1487
])],
@@ -1509,10 +1539,10 @@ void main() {
1509
1539
'<ol>\n <li>\n <blockquote>\n <h6>two</h6>\n <ul>\n <li>three</li>\n '
1510
1540
'</ul>\n </blockquote>\n <div class="codehilite"><pre><span></span>'
1511
1541
'<code>four\n </code></pre></div>\n\n </li>\n </ol>' , const [
1512
- ListNode ( ListStyle .ordered, [[
1542
+ OrderedListNode (items : [[
1513
1543
QuotationNode ([
1514
1544
HeadingNode (level: HeadingLevel .h6, links: null , nodes: [TextNode ('two' )]),
1515
- ListNode ( ListStyle .unordered, [[
1545
+ UnorderedListNode (items : [[
1516
1546
ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('three' )]),
1517
1547
]]),
1518
1548
]),
0 commit comments